昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期五, 八月 02, 2013

How to undo an amend commit

git reflog is useful

# Move the current head so that it's pointing at the old commit # Leave the index intact for redoing the commit git reset --soft HEAD@{1} # commit the current tree using the commit details of the previous # HEAD commit. (Note that HEAD@{1} is pointing somewhere different from the # previous command. It's now pointing at the erroneously amended commit.) git commit -C HEAD@{1}

ref: http://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit

--
Feng

没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.