amend last commit git code example Example: git amend git commit --amend -m "an updated commit message"