Let\'s say I have:
A - B - C - D - E - F master
\\
\\- G - H new feature branch
Now I realize that commits B an
To fix master:
git checkout A
git cherry-pick master~3..master # apply the changes we actually want to keep on master
git branch -f master # reposition master on new position
git checkout master
To drop commit D from the feature branch:
git checkout feature-branch~3 # or git checkout C
git cherry-pick feature-branch~2..feature-branch # apply the last 2 revisions
git branch -f feature-branch
git checkout feature-branch