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

后端 未结 4 675
孤城傲影
孤城傲影 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:10

    This one will surely work!

    git reset --hard HEAD~1 
    git init
    

    The first one will revert the changes you recently made (the merge) the second will init the repo to latest (therefore will fast forward to latest on origin)

    I've tried

    git reset --merge
    

    but it didn't do the trick.

提交回复
热议问题