view last commit changes code example
Example 1: edit last commit message
git commit --amend -m "New commit message."
Example 2: how to abandon changes and go last commit
#ignore all changes, and back to last commit
git add .
git stash
git commit --amend -m "New commit message."
#ignore all changes, and back to last commit
git add .
git stash