I deleted a file on my desktop by mistake, how can I get it from the remote master?
+6
A:
git checkout -- /path/to/file
should be enough to restore it, since you have a local repo with that file in it.
That would restore your file at the version of the file present in the index.
(i.e. the last version you ran git add
on it).
To restore it at the latest commit of your current branch:
git checkout HEAD -- /path/to/file
VonC
2010-07-01 20:25:00