使用Git for Windows - 意外失去了大量工作。我可以拿回来吗? [英] Using Git for Windows - Accidentally lost a ton of work. Can I get it back?

查看:83
本文介绍了使用Git for Windows - 意外失去了大量工作。我可以拿回来吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我之前在Git中编辑过一个文件,我保存了它,但没有承诺。我做了其他一些文件更改,并提交并推送它们。然而,一个文件被搞砸了,所以我点击了最后一次成功的提交,并按下回滚到此提交。令我惊骇的是,它抹去了我所有未经承诺的改变,现在我不知道如何让他们回来,因为他们没有承诺。

解决方案

你说你没有提交。不幸的是,git只保存提交而不是撤消工作。所以,尽管我很抱歉,但没有办法使用git来恢复您的工作。



但是您可以尝试恢复已删除的文件

您可能还想看看这是编码恐怖邮件。


I am so confused and I think I've lost hours of work.

I was editing a file in Git earlier, and I saved it, but did not commit. I did do a few other file changes, and commited and pushed them. However, one file was messed up, so I clicked on the last successful commit, and pressed "roll back to this commit." To my horror, it erased all my uncommitted changes, and now I have no idea how to get them back since they were not committed.

解决方案

You say that you didn't commit it. Unfortunately git only saves commits and not undone work. So, as sorry as I am, there is no way to use git to get your work back.

But you could try to restore the deleted files.

You might also want to have a look at this coding horror post.

这篇关于使用Git for Windows - 意外失去了大量工作。我可以拿回来吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆