What\'s the best way to revert a committed git merge while keeping the option of merging the same branch at a later point?
This is for a situation when I merge a bra
If you have not yet published your merge commit (pushed to the central server), the best solution is to rewrite history to remove the merge commit.
git reset HEAD^
git rebase -i
If you have published the merge, you will need to decide whether it is better to rewrite history to preserve proper merge potential for your branch, or simply add a revert commit. This will require talking to everyone who may have potentially downloaded the merge.
If you cannot rewrite history, you'll need to do a revert:
git revert -m 1
In this case, a future merge of the branch will need manual intervention. You may need to cherry-pick commits that are not picked up by the merge, or revert your revert commit.