How to undo merge of master branch?

This question already has an answer here:

  • Undo a Git merge that hasn't been pushed yet 25 answers

  • There is no ongoing merge pending so git is supposed to show you,

    fatal: There is no merge to abort (MERGE_HEAD missing).
    

    Now if you want to go back to previous state (state before you merged), try

    $ git branch
          Experimentation
        * master
          pod-attempt
    $ git reset --hard HEAD~24
    

    You are done!

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

    上一篇: 我如何删除Git合并?

    下一篇: 如何撤消主分支的合并?