git undo last commit

$ git commit -m "Something terribly misguided"              (1)
$ git reset --soft HEAD~                                    (2)
<< edit files as necessary >>                               (3)
$ git add ...                                               (4)
$ git commit -c ORIG_HEAD                                   (5)


转自: http://stackoverflow.com/questions/927358/how-do-you-undo-the-last-commit
posted @ 2016-04-12 21:50  圆旭  阅读(1390)  评论(0编辑  收藏  举报