Undoing a git merge

前端 未结 2 1902
南方客
南方客 2021-02-20 14:45

I\'m not that experienced with Git and now I have a big problem falling into my lap.

Here\'s how my current branch look like:

feature       /---F1-----F2         


        
2条回答
  •  死守一世寂寞
    2021-02-20 15:01

    If you didn't push (publish) the merge commits yet, use git reset. E.g. on the master branch, assuming your working tree is clean, do git reset --hard .

    More info: Undo a Git merge that hasn't been pushed yet

    If you did publish your changes you might want to consider making a revert commit instead. More info here: http://progit.org/2010/03/02/undoing-merges.html

提交回复
热议问题