Suppose I have this feature branch \"foo\". Now I want to merge it back into master, but I\'ve added some debugging code that I don\'t want in master.
The debug cod
I've had success with:
git rebase -p --onto SHA^ SHA
Where SHA is the commit you want to remove.
SHA
via http://sethrobertson.github.io/GitFixUm/fixup.html#remove_deep