Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
As I was deleting files I accidentally deleted a .m file. I tried to undo to get it buck but it is greyed out. The undo is greyed out and it is not located in the project folder. Can it be recovered? I did rename some ivars and xcode asked if I wanted to enable SnapShot, can I retrieve it from a saved version?
 
Yep, not in the trash. Seems like xcode deletes them without sending to trash. I hope there is a preference for that.

I downloaded a program called Disk Drill. It is kinda free to scan the drive but when you want to recover you need to spend the money. But it has a view feature that is free. It found the delete viewController.m file but instead of spending $90 to recover I took screen shots of the documents and I'm retyping it now.

Kind of solved the problem.
 
There are two kinds of people in the world. Those that have lost data and those that will lose data.

Every programmer today should be using source-code control. You should learn how to use git. It's part of Xcode. You can have free online storage at a number of hosts suitable for modest sized projects. I've used bitbucket.com and there are others.

You should also have a backup drive and use Time machine.
 
There are two kinds of people in the world. Those that have lost data and those that will lose data.

I consider myself to be both simultaneously!

You should learn how to use git

This. And you can even add a git repository to an existing project. The version editor makes it really easy to compare files. It's perfect for those oh-I-wish-I-hadn't-done-that moments.

... use Time machine.

This. Time Machine saved me from loosing several hours worth of work when I irreversibly made certain changes to the wrong database file.
 
Are you sure you didn't just delete the reference to the file?

There are two options when you delete. I thought one moved to trash the other keeps the file where it was but de-references it from the project.

oh yeah another +1 to source control and remember to check in your files regularly and branch before making changes to working code.
 
I check both in the trash can and also in the project folder. It was gone and what a sinking feeling you get in your stomach when that happens.
 
It's always quicker the second time. It's not fun but is quicker. :p

Cold comfort of someone who has lost much productivity of the years to technology and backups.
 
Learn to use git and you will be able to recover things like this. Ray Wenderlick's site has an excellent tutorial.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.