Git-Flow undo a finished feature branch

萝らか妹 提交于 2019-12-04 06:39:43
Nils Werner

Run this command

git revert -m 1 <sha1 of M>

Explanation

Your situation is about as follows:

A-B-----C---D-M     # master
   \         /
    X-Y---Z-        # supercool-feature

A, B, C and D were in your master branch, X, Y and Z in your feature branch. When you did git merge supercool-feature Git created a "merge commit" M for you. This commit encloses all commits from your feature branch as well as possible fixes to fix merge conflicts. So if you revert that one commit, every change from your featurebranch will be gone again.

Actually the command is

git revert -m 1 <sha1 of M>

which remove M moving back on branch containing X,Y,Z which is not the mainline 1.

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