Linus Torvalds [off-list ref] writes:
So depending on what your situation is, this sequence actually works:
#
# Create and check out a "fixes" branch that has the
# known-broken commit as its head commit
#
git checkout -b fixes <BROKEN-COMMIT>
.. edit edit edit to fix the broken commit ..
#
# Then, just _replace_ the broken commit with the fixed state
# by doing a "git commit --amend"
#
git commit -a --amend
#
# ok, now the "fixed-branch" is in good shape, but we
# want to re-surrect our original 'master' branch WITH the
# fix, and based on the fixed branch, so we rebase the
# master branch# _onto_ the fixed state in "fixes", with
# the broken commit (that we do _not_ want to include) as
# the base.
#
git rebase --onto fixes <BROKEN-COMMIT> master
Somebody else should verify that "git rebase" thing.
Looks fine.