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