简体   繁体   English

如何撤消 git VS 代码中的丢弃更改?

[英]How do I undo discard changes in git VS Code?

I was trying to open a repository but instead I opened a folder on my computer with all my work, I didn't know how to close it and I just moved the folder to another location, but I lost all the files I had in that folder.我试图打开一个存储库,但是我在我的计算机上打开了一个包含我所有工作的文件夹,我不知道如何关闭它,我只是将文件夹移动到另一个位置,但是我丢失了其中的所有文件文件夹。 Is there a way to recover my files?有没有办法恢复我的文件? I am using Ubuntu.我正在使用 Ubuntu。

Use git log and check for the commit and later use git revert to revert the commi, this should usually solve the problem.使用 git 日志并检查提交,然后使用 git revert 恢复 commi,这通常应该可以解决问题。

ok, I just fixed it, I needed to install a program called r-linux and recover the files again.好的,我刚刚修复了它,我需要安装一个名为 r-linux 的程序并再次恢复文件。 It took a few minutes but apparently everything is fine.花了几分钟,但显然一切都很好。

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

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