Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.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
Git 源代码在尝试将其上传到repo后消失_Git_Repository - Fatal编程技术网

Git 源代码在尝试将其上传到repo后消失

Git 源代码在尝试将其上传到repo后消失,git,repository,Git,Repository,我已经按照问题的第一个答案将我的源代码上传到我的repo,但我的文件被删除了。现在只有一个README.md文件和.git文件夹 我能恢复那些文件吗 编辑:我刚刚意识到,我忘了做git提交-m“initial commit comment”,只做了 git添加。 我刚刚意识到,我忘了做git提交-m'initial commit comment',只做了git添加。 然后git pull可能会将工作树重新初始化为远程内容(因此出现了README.md) 您可以尝试通过以下方式从索引中恢复文件“”

我已经按照问题的第一个答案将我的源代码上传到我的repo,但我的文件被删除了。现在只有一个README.md文件和.git文件夹

我能恢复那些文件吗

编辑:我刚刚意识到,我忘了做
git提交-m“initial commit comment”
,只做了
git添加。

我刚刚意识到,我忘了做
git提交-m'initial commit comment'
,只做了
git添加。

然后git pull可能会将工作树重新初始化为远程内容(因此出现了
README.md

您可以尝试通过以下方式从索引中恢复文件“”:

  • 对当前回购进行完整备份
  • 尝试一个git fsck--full--unreachable--no reflog
我刚刚意识到,我忘了做
git提交-m'initial commit comment'
,只做了
git添加。

然后git pull可能会将工作树重新初始化为远程内容(因此出现了
README.md

您可以尝试通过以下方式从索引中恢复文件“”:

  • 对当前回购进行完整备份
  • 尝试一个git fsck--full--unreachable--no reflog

非常感谢。你救了我:)非常感谢。你救了我:)