How do you revert a faulty git merge commit

So one of my coworkers accidentally made a merge that actually only kept one side of the tree. So he started a merge, deleted all the changes introduced by the merge, and then committed the merge.

Here is a simple test case I did on a test repo. This repo has three branches. idx is the topic branch that was accidentally merged, and master is the mainline. dev is just a test of how revert -m works so you can ignore it.

alt text

What I want to do is revert the faulty merge. So from master I try to run git revert -m 1 but then git responds with:

# On branch master                               
nothing to commit (working directory clean)

So it doesn't actually create a revert commit that undoes the merge. I believe that this happens because the merge didn't actually contain any real changes.

If you want to play around with my test repo you can download it from here

Is this a git bug, or am I missing something?

16
задан Jason Axelson 3 November 2010 в 23:52
поделиться