XCode - 在“放弃更改”之后恢复代码的任何方法? [英] XCode - Any way to recover code after "Discard Changes"?

查看:139
本文介绍了XCode - 在“放弃更改”之后恢复代码的任何方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨晚我无意中做了一件非常愚蠢的事。我已经在iPad项目上工作了几个月,而且(甚至更愚蠢)没有备份。通过右键单击XCODE中的项目,我错误地点击了放弃更改



(愚蠢再次统治)我从最初和我做的时候都没有任何提交丢弃变更,似乎它一直回到初始提交,如果我正确地看事情看起来像每个文件是第一次保存。



我的问题是:有没有办法恢复我的工作?它在.git目录中吗?副本存储在别处吗?或作为最后的手段,是否有机会使用取消删除实用程序恢复某些源文本?



谢谢,



Bob

解决方案

毕竟幸运的是在我身边。事实证明,当我执行Source Control> Discard Changes操作时,它没有对我的项目目录中的源代码保存进行任何更改。我能够启动一个新项目并重新添加文件。一旦我这样做,我就能够在事件发生之前在模拟器中编译和运行我的项目。我现在有一个备份,并在git中提交了更改。


I inadvertantly did a very stupid thing last night. I have been working on an iPad project for a couple of months and (even more stupidly) do not have a backup. By right-clicking on the project in XCODE, I mistakenly clicked "Discard Changes"

(stupidity reigns again) I did not have any commits since the initial and when I did the Discard Changes, it seems that it went all the way back to the initial commit, which if I am looking at things correctly looks like each file is as it was the very first time it was saved.

My question is: Is there a way to recover my work? Is it in the .git directory? Is a copy stored elsewhere? or as a last resort, any chance to recover some of the source text with an un-delete utility?

Thanks,

Bob

解决方案

Well luck was on my side after all. As it turns out, when I did the Source Control > Discard Changes operation, it did not make any changes to the source code save in my project directory. I was able to start a new project and added the files back in. Once I did that I was able to compile and run my project in the simulator just as it was before the incident. I now have a backup as well as committed the changes in git.

这篇关于XCode - 在“放弃更改”之后恢复代码的任何方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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