xxxxxxxxxx
git commit --amend -m "an updated commit message"
xxxxxxxxxx
Usually the easiest way to apply a bug fix and to correct the history is to:
use git commit --fixup=commit when committing your fix,
use git rebase --interactive --autosquash commit~1 to rebase,
save the file one it open, and then wait for the rebase to complete.
where commit is the ash of the commit to amend
xxxxxxxxxx
git commit --amend -m "Updated message for the previous commit"