开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜