Revert merge Git-Flow

随声附和 提交于 2019-12-04 11:06:34
1615903

This is quite easy. Things you will need to do are:

  • Reset develop branch to the commit it was before merge

  • Reset master branch to the commit it was before merge

  • Have the release branch point to the correct commit again

  • Remove the tag

  • Push the fixed commits to remote

So to do steps 1 and 2:

git checkout develop
git reset --hard 4332fe4

git checkout master
git reset --hard <SHA of the commit the master was before the merge>

Then to "recreate" the release branch:

git checkout -b "release/v1.0.1" 28a63ea

And finally to remove the tag:

git tag -d v1.0.1

More information about undoing a merge in this stackoverflow question

After that, if the changes were already pushed, you need to use the -f switch to override changes in remote:

git push -f

And to delete the tag from the remote:

git push --delete origin v1.0.1
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!