0

I have the situation:

Branch DEV was merged in branch ABC long time ago!

After this time the team did a lot of changes in branch ABC, now the team realize the branch DEV was not supposed to be merged in ABC.

So basically we need a new branch without the development code on it and in the same time with all the updates from ABC.

In this case what is the best approach?

  • Can you express "DEV was merged in branch ABC" more precisely? Which branch was merged _into_ which branch? – matt Jul 05 '22 at 19:11
  • 2
    Does this answer your question? [How to revert a merge commit that's already pushed to remote branch?](https://stackoverflow.com/questions/7099833/how-to-revert-a-merge-commit-thats-already-pushed-to-remote-branch) You can simply revert the merge commit that brought branch `DEV` into `ABC`. You may have conflicts but there isn't much you can do about that except to resolve them. Note an alternative is a rewrite of `ABC` to not include that merge, but it's probably more complicated at this point than just reverting the merge. – TTT Jul 05 '22 at 19:49
  • 1
    My question: is there stuff in DEV that should not even be in the history of ABC at all for some reason? If so, you're looking at rewriting the history, with either a series of cherry picks or a carefully crafted rebase. If not, I'm with TTT, just revert the merge. – joanis Jul 06 '22 at 02:52

0 Answers0