How do i undo a merge that has been pushed and later been branched off? And what happens to the repo?
This has been asked in different variations before but im not sure if any of the answers explains what happens after.
Assume this is the state of the repo:
\ / \
What i want is to undo the merge and continue working on the DEF branch
Undoing a merge through a revert is one way which at least does not change the history of the main branch
git revert -m 1 G
And you can go on on branch
DEFn which is unaware of the merge: you can add new commits and merge later.
However, as commented by lucash, that will not reapply the changes from commits
F but only merge the new commits from that branch, most probably leading to problems due to the missing changes which were aware in the
So you will need first to revert the revert-commit (result of
git revert -m 1 G) before merging the branch to avoid that problem.
IJK can remain on
H: the revert would have cancelled changes introduced by
G, and would not have affected