How I undo my last commit?

This question already has an answer here:

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

  • You could do this:

    git reset --soft HEAD~
    

    This will not remove new files or changes in the files. It only reverts the commit so the commit never happened. If you want the changes not to be in the files use --hard instead of --soft .


    如果一切都在本地完成,只需将分支重置为先前的提交。

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

    上一篇: 如何撤消上次提交

    下一篇: 我如何撤消最后一次提交?