How to abandon changes in git

Posted in Articles

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

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>