Last Updated: 2021-05-15
I merged in a feature branch
master but then was hit by
a bug in production that I wanted to address before this big feature deploy. So
I reverted the feature merge with
git revert -m 1 SHA.
-m 1 means "mainline 1", which means "the branch that was merged
into" - i.e. go back to the old master. Compare to
So far no surprises.
Later on, when the feature was ready, I merged in this same (already merged but
since reverted) branch
git merge rewrite_checkout, but got tons of surprising
conflicts about stuff that should have already been resolved.
The solution was to undo the revert commit - to revert the revert. Then I had zero conflicts.
If you reverted a merge on a branch, then later try to merge in the same branch again, you will get a mess unless you revert the revert.