Reading the answers to:
Git - Remove commit from history
I only see suggestions involving interactively editing a TODO file. Is there a way to drop a single commit, given its hash, and keep ("pick") all subsequent commits, without user interaction?
Reading the answers to:
Git - Remove commit from history
I only see suggestions involving interactively editing a TODO file. Is there a way to drop a single commit, given its hash, and keep ("pick") all subsequent commits, without user interaction?
 
    
    Basic solution:
A solution due to a comment by @phd, and originally found here:
To remove the commit with hash value SHA, write:
git rebase --onto SHA^ SHA
But remember that rebasing and merges have complex interactions, which you should read about if your history involves merges.
Cherry on top:
You can create an alias for this idiom, via ~/.gitconfig:
[alias]
    drop = !git rebase --onto $1^ $1 && :
with which you will be able to write simply:
git drop SHA
