Move (or "Undo") last git commit to unstaged area
This question already has an answer here:
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
命令,这是一种更容易记住的做同样事情的方式(以及许多其他方便的额外功能,如名称所示)。
上一篇: 在git中还没有推送到远程的几个提交