How to undo git flow feature finish?

巧了我就是萌 提交于 2019-12-03 01:39:46

问题


I am learning git-flow and I just did git flow feature finish <feature-name>, which merged my feature branch to develop and removed it.

Instead of this, I want to push the feature branch to github, so I can merge it after a peer review.

So the question is, how do I 'undo' this command. Or in other words , how can I move my last two commits from develop to my feature branch?


回答1:


These steps should do the trick:

Get the sha's needed:

git log

<sha1> is the commit right before the merge
<sha2> is the last commit on develop before you started working on the feature

git checkout develop
git checkout -b feature/<feature-name>
git reset <sha1> --hard
git checkout develop
git reset <sha2> --hard

Push your feature branch.



来源:https://stackoverflow.com/questions/13450039/how-to-undo-git-flow-feature-finish

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