Git merge in wrong direction

Reverting a merge on the branch is as simple as determining which commit was the previous one.

First, checkout on the branch you want to modify. It's a git-golden-rule: you can only modify the branch you're on.

git checkout master

Then, figure out the previous-master commit it, and force master back into its previous state

git reset --hard <previous-commit-id>

Finally, do your merge right

git checkout devel
git merge master

What you could also do, if you want to be lazy, is invert branch states.

You still need to find master's previous commit-id.

Then:

git checkout devel
git reset --hard master
git checkout master
git reset --hard <previous-commit-id>

Tags:

Git

Merge