It's:
git rebase --onto commit_before commit_to_delete
eg. with following commits: A‑B‑C‑D
, where A
being the newest and D
the most recent and HEAD, executing git rebase --onto A B
results in A‑C'‑D'
, effectively "deleting" B
.
Note that you can get rid of several commits in a row: git rebase --onto A C
results in: A‑D'
.