- Get commit hash (eg. 8fd8s97fcd)
$ git rebase --interactive '8fd8s97fcd^'
- In the editor, change 8fd8s97fcd from
pick
toedit
and save, exit - At this point, 8fd8s97fcd is your last commit
- Make changes
$ git add
$ git commit --all --amend --no-edit
$ git rebase --continue
Credits: https://stackoverflow.com/a/1186549