Tuesday, December 13, 2011

git discard changes to a file


git checkout -f -- "filename"
Note, there is a space between -- and "filename".

Other methods:
git checkout -f

=========================================
To discard local commits:

git reset --hard origin/master

No comments: