Git: how to reverse-merge a commit?

前端 未结 5 648
日久生厌
日久生厌 2020-12-07 11:46

With SVN it is easy to reverse-merge a commit, but how to do that with Git?

5条回答
  •  悲哀的现实
    2020-12-07 12:08

    To create a new commit that 'undoes' the changes of a past commit, use:

    $ git revert 
    

    It's also possible to actually remove a commit from an arbitrary point in the past by rebasing and then resetting, but you really don't want to do that if you have already pushed your commits to another repository (or someone else has pulled from you).

提交回复
热议问题