We have a master branch into which we've merged about 10 feature branches, one at a time.
So the recent history looks like this:
merged feat/10 (HEAD of master)
merged feat/9
merged feat/8
merged feat/7
merged feat/6
merged feat/5
...
Now we found out that feat/7
was bad and we want to take it out of master. Reverting that merge commit isn't enough because we don't want that broken commit to exist in our history at all. We can't really use interactive rebase because that will flatten out the history to make it look as if it was all done on a single branch, and we want to preserve all that good merge history.
Is there a way to zap out a particular merge commit from a branch's history?
I'll note that the real history is much more complex than what you see in the example above, so manually re-doing all the merges since feat/7 wouldn't be a good option.
Edit
To clarify for those who vote to close this as a dup: this isn't the FAQ about how to take out a commit with rebase, which of course has been answered many times. The question here is about taking out a commit without flattening the merge history.