[英]How to get back to an older version of my project Xcode 10
I have a very old project I was working on to revive it. 我有一个很老的项目正在努力使它恢复活力。 I deleted some infoplist.strings files first, then by mistake the storyboard file. 我先删除了一些infoplist.strings文件,然后错误地删除了故事板文件。 So Xcode 10 started complaining. 因此Xcode 10开始抱怨。 I thought maybe I can get my deleted files back if I press Source Control -> Discard all changes. 我想如果按Source Control-> Discard all changes,也许我可以找回删除的文件。 And then I lost the whole project, code and everything. 然后我失去了整个项目,代码和所有内容。 All the files in the project are gone. 项目中的所有文件都消失了。 So please tell me there is a way to get back my files. 因此,请告诉我有一种方法可以取回我的文件。 PS: I did close the project that went wrong. PS:我确实关闭了出错的项目。 And opened it again, then there was thus, the basic files a simple project starts with. 再次打开它,然后有了一个简单项目的基础文件。
You can go back to the last commit before you discarded the changes by using Xcode's source control navigator. 您可以使用Xcode的源代码管理导航器返回上一次提交,然后再放弃更改。 Select the current branch from the source control navigator to see all the commits for that branch. 从源代码管理器导航器中选择当前分支,以查看该分支的所有提交。
Select the commit you want to go back to, right-click, and choose Branch from. 选择要返回的提交,单击鼠标右键,然后选择“分支来自”。 A sheet opens. 一张纸打开。 Enter a name for the branch and click the Create button. 输入分支的名称,然后单击创建按钮。 Now you're back to the older version of the project. 现在,您回到了项目的旧版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.