Yeongchan Jeon
Yeongchan Jeon

Reputation: 519

Can I restore my Xcode source files back to a few hours ago?

I have used Xcode 7.something with Swift 2.2 or 2.3(even I cannot remember).

I upgraded my Xcode to version 8 and reformed the project to swift 3 syntax; which gave me a tremendous amount of errors.

I couldn't restore the project folder which was before the reform; just copied the converted file to somewhere else.

Then tried to convert back to 2.3 then I got even more errors... So I'm trying to find any way to restore the whole project file back to a few hours ago. Is there any way to get this successfully done? Thanks in advance!

Upvotes: 0

Views: 204

Answers (1)

Duncan C
Duncan C

Reputation: 131398

If you used source control (git is the most common) and committed before and after then yes. (You should be using source control, and you should commit before doing something as sweeping as an upgrade from Swift 3.0)

If you have a backup then you can restore from a backup. (And you should be doing regular backups.)

If you haven't quit Xcode, and haven't closed the source files, you may be able to use multiple undo to back out the changes. (I suspect not on an automatic upgrade, but it's at least worth checking.)

If none of the above then you're probably out of luck and will need to work out the errors manually.

Swift 2 to Swift 3 is a big change, and there are going to be errors. It's painful, but a one-time thing.

Upvotes: 1

Related Questions