Steps i performed:
I have two branches branch1 and branch2,
$git branch --Initial state $branch1 $git checkout branch2 $git pull origin branch1 --Step1
You can revert the merge following the official guide, however this leaves Git with the erroneous belief that the merged commits are still on the target branch.
Basically you have to :
git revert -m 1 (Commit id of the merge commit)