Re-doing a reverted merge in Git

前端 未结 8 2238
一个人的身影
一个人的身影 2020-11-22 11:10

I have run into a bit of a problem here: I had a problem-specific branch 28s in Git, that I merged in the general develop branch. Turns out I had d

8条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 11:42

    1. create new branch at commit prior to the original merge - call it it 'develop-base'
    2. perform interactive rebase of 'develop' on top of 'develop-base' (even though it's already on top). During interactive rebase, you'll have the opportunity to remove both the merge commit, and the commit that reversed the merge, i.e. remove both events from git history

    At this point you'll have a clean 'develop' branch to which you can merge your feature brach as you regularly do.

提交回复
热议问题