I accidently pushed after pulling from staging. Now, I try to revert those changes but then I got the error below:
error: commit [hash] is a merge but no -m option was given.
fatal: revert failed
Does anyone know how we can solve this?
Thank you for your assistance!
Welcome to the Atlassian community!
I would run git revert -m 1 <merge-commit-hash>, in the terminal, then push from Sourcetree as normal.
Sourcetree's Reverse commit cannot do this, because Git needs to be told which parent of the merge to keep. -m 1 keeps the branch you merged into and undoes what came in from the other side.
One thing to watch: reverting a merge blocks those commits from coming back if you merge that branch again later. You would need to revert the revert at that point.
Cheers, Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.