Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 如何从GitHub存储库恢复已删除的文件?_File_Github_Restore - Fatal编程技术网

File 如何从GitHub存储库恢复已删除的文件?

File 如何从GitHub存储库恢复已删除的文件?,file,github,restore,File,Github,Restore,我不小心从本地存储库中删除了我的文件(我甚至不知道会发生这种情况),我今天刚开始使用github,我想共享一些文件,当时我选择了“停止监视此存储库”(或类似的选项)它删除了其中的所有文件,在过去的几个小时里,我正在尝试恢复它们。我使用了几个恢复文件软件,但没有一个能够找到它们。我还在谷歌上研究如何从github恢复已删除的文件,我的发现让我: git log --diff-filter=D --summary 显示所有已删除的文件及其路径,然后我尝试使用: git checkout -- b

我不小心从本地存储库中删除了我的文件(我甚至不知道会发生这种情况),我今天刚开始使用github,我想共享一些文件,当时我选择了“停止监视此存储库”(或类似的选项)它删除了其中的所有文件,在过去的几个小时里,我正在尝试恢复它们。我使用了几个恢复文件软件,但没有一个能够找到它们。我还在谷歌上研究如何从github恢复已删除的文件,我的发现让我:

git log --diff-filter=D --summary 
显示所有已删除的文件及其路径,然后我尝试使用:

git checkout -- bit checker.cs 
无论是否使用完整路径,结果都是相同的:

error: pathspec 'bit' did not match any file(s) known to git.
error: pathspec 'checker.cs' did not match any file(s) known to git.

有什么建议吗?

我认为您需要指定sha1在签出时提交。这告诉我什么,就像我说的,今天是我使用github的第一天,所以您可以更具体一些吗?:)