How to abandon changes in git
Suppose you are using git on the master branch and made a change to a file that you don’t want to commit. You want to abandon this change and restore the version that was committed.
The command is …
git checkout — <filename>