git commit amend last commit code example Example 1: git amend git commit --amend Example 2: git command change to previous comit git reflog git checkout HEAD@{...}