How can I obliterate a commit, but keep subsequent commits intact?
In this scenario, suppose I want to get rid of b
but keep c
.
$ git init
$ for i in a b c; do date >$i; git add $i; git commit -m add-$i;done
$ git log
commit 39c976fa711b38d4c8161af9b6b4a9a91489d079
add-c
commit 2913863926f8c3a3898a2763fe4384b6ca7227a0
add-b
commit ff591ea43a84069e5effd28125b56243dc264336
add-a
doing a reset --hard
will get rid of b
, but also gets rid of c
.
git reset --hard ff591e
HEAD is now at ff591ea add-a
How can I perform this operation while keeping the add-c
commit intact?