今天发现github 中某个文件丢失了,只记得些文件名的一些关键词,搜索了下,使用
git ls-files --deleted
没有效果。
请问下 是否可以通过一些关键词找到被删除的文件,然后恢复。
我的git version 是 1.9.4-preview20140929.
感谢。
PHPz2017-04-28 09:07:55
This software is called Git, not GitHub!
git log -S字符串
或者 git log -G正则
可以搜索。具体功能和用法请见手册(man git-log
).
仅有的幸福2017-04-28 09:07:55
Gitk gives it a try, brings up the visualization window, and uses the search function to search for the file.
为情所困2017-04-28 09:07:55
Just checkout the file directly from the local server. There is no need to pull it from the remote server
Because all historical versions are available locally.
git checkout file
Recover multiple deleted files at the same time: git ls-files -d | xargs -i git checkout {}
Reference: How to restore locally deleted files with git