Undo a git merge (hasn't been pushed yet)

后端 未结 4 674
孤城傲影
孤城傲影 2021-01-30 10:30

I just committed some changes into one of my feature branches (\"feedback_tab\") then, checked out \"master\" and merged them in there. I actually meant to merge them into my \

4条回答
  •  情歌与酒
    2021-01-30 11:25

    git reset --hard HEAD~17 takes you back 17 commits ahead of the head of master. git rebase -i HEAD~17 probably gets rid of the extra commits as well.

提交回复
热议问题