Deleted a file by mistake, how to get from origin master?
I deleted a file o开发者_运维问答n my desktop by mistake, how can I get it from the remote master?
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
精彩评论