how do i undo a latest commit locally code example Example: undo local commit $ git reset --soft HEAD~1