How to pull a specific file with GIT? [duplicate]
Say you just want to get rid of the changes you've made to one file, and get back to whatever is in the repository. I used to do this in svn:
rm a-file.txt
svn update a-file.txt
What is the equivalent in Git? I know how to fetch/pull evrything fr开发者_StackOverflowom the repository, but how about one single file?
To undo your (uncommitted) changes:
git checkout a-file.txt
If you have committed changes and want to undo them back to a certain previous commit:
git checkout [some-older-commit-ref] a-file.txt
Btw, with Subversion you should have done:
svn revert a-file.txt
精彩评论