Undo a Git merge that hasn't been pushed yet

前端 未结 30 2246
情歌与酒
情歌与酒 2020-11-21 22:27

Within my master branch, I did a git merge some-other-branch locally, but never pushed the changes to origin master. I didn\'t mean to merge, so I\'d like to un

30条回答
  •  臣服心动
    2020-11-21 23:03

    The simplest of the simplest chance, much simpler than anything said here:

    Remove your local branch (local, not remote) and pull it again. This way you'll undo the changes on your master branch and anyone will be affected by the change you don't want to push. Start it over.

提交回复
热议问题