Rollback a Git merge

后端 未结 5 951
时光说笑
时光说笑 2020-12-04 05:02
develop branch
--> dashboard (working branch)

I use git merge --no-ff develop to merge any upstream changes into dashboard

5条回答
  •  暖寄归人
    2020-12-04 05:29

    Just reset the merge commit with git reset --hard HEAD^.

    If you use --no-ff git always creates a merge, even if you did not commit anything in between. Without --no-ff git will just do a fast forward, meaning your branches HEAD will be set to HEAD of the merged branch. To resolve this find the commit-id you want to revert to and git reset --hard $COMMITID.

提交回复
热议问题