简体   繁体   English

Visual Studio git 推送失败,lost.sln 并且无法恢复项目

[英]Visual studio git push failed, lost .sln and cannot recover project

This is my final assignment for my course.这是我最后的课程作业。 I worked really hard on it, and was supposed to push the files to a git repository.我非常努力地工作,并且应该将文件推送到 git 存储库。 I tried doing so and it failed, I believe I pressed revert afterwards, it did nothing.我尝试这样做但失败了,我相信我后来按下了还原,它什么也没做。

When I went to check to my local repository, my usual files were gone, I got two new hidden folders vs. and git.当我去查看我的本地存储库时,我常用的文件不见了,我得到了两个新的隐藏文件夹和 git。 I can find the debugged.exe file which runs okay, but I really need my code back.我可以找到运行正常的 debugged.exe 文件,但我真的需要我的代码。

Is there any way to retrieve it?有没有办法找回它?

More info: my.cpp files are now.obj files, I can't find the.h files, there are also.exe.recipe files, and some.idb and.pdb files in the folder.更多信息:my.cpp 文件现在是.obj 文件,我找不到.h 文件,文件夹中还有.exe.recipe 文件,以及一些.idb 和.pdb 文件。

I managed to retrieve my original files by using git reflog, followed by git reset —hard Head@{n}, and then git retrieve for each file.我设法通过使用 git reflog 来检索我的原始文件,然后是 git reset —hard Head@{n},然后是 git 检索每个文件。 Thanks everyone.感谢大家。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM