git reset hard remove all local changes code example Example: clear local changes in git git checkout .