Sometimes rebasing directly is not feasible, e.g. when you have a
botched merge commit that you have fixed, but later realized you
wanted to roll into the same commit. In this scenario you can usually
use a combination of reset and commit --amend. Using the same
example as above:

reset --soft will rewind the current branch, but leave the index
intact so that commit --amend can update the first commit. Adding
-C HEAD will reuse its commit message. The end result should be similar: