简体   繁体   English

如何将本地git存储库转换回vs2015项目文件?

[英]How to convert local git repository back to vs2015 project files?

I foolishly clicked 'Publish' bottom right hand corner of vs2015 whilst my project was open, now my project file have been converted into what appears to be a git local repository, how do I get my project files back? 在我打开项目时,我愚蠢地单击了vs2015的右下角的“发布”,现在我的项目文件已转换为git本地存储库,我该如何找回我的项目文件?

在此处输入图片说明


在此处输入图片说明

Usually checking git status tells you what you need to do, for it tells you every file that has changed. 通常检查git status告诉您您需要做什么,因为它会告诉您每个已更改的文件。 So, if your files where deleted, all you have to do is 因此,如果您的文件已删除,那么您要做的就是

git checkout -- .

This will revert all uncommitted changes. 这将还原所有未提交的更改。 If, however, the changes where committed, you can do 但是,如果更改已提交,则可以执行

git reset --hard HEAD^

Please note that the second line of code I presented will send you back one commit prior to the one you're in (HEAD), with no (trivial) way of undoing. 请注意,我提供的第二行代码将向您发送回一个提交,比您在(HEAD)中的提交要早,并且没有(平凡的)撤消方式。

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

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