how git amend rewrite history code example Example 1: git amend git commit --amend Example 2: add change to last commit $ (some_branch) git commit --amend