Move (or "Undo") last git commit to unstaged area

This question already has an answer here:

  • How to undo the most recent commits in Git? 69 answers

  • To have the files marked for commit use

    git reset --soft HEAD^
    

    And otherwise

    git reset HEAD^
    

    --soft

    (…) This leaves all your changed files "Changes to be committed", as git status would put it.


    git-extras提供了一个git undo命令,这是一种更容易记住的做同样事情的方式(以及许多其他方便的额外功能,如名称所示)。

    链接地址: http://www.djcxy.com/p/568.html

    上一篇: 在git中还没有推送到远程的几个提交

    下一篇: 移动(或“撤消”)最后的git提交到非分区