github discard all changes since last commit code example
Example 1: clear local changes in git
git checkout .
Example 2: how to abandon changes and go last commit
#ignore all changes, and back to last commit
git add .
git stash
git checkout .
#ignore all changes, and back to last commit
git add .
git stash