4

Using Eclipse I accidentally deleted the wrong folder on my file system and lost hundreds of java files on my mac yesterday.

I am using a second mac to connect to my mac via firewire. My mac appears as an external disk on the second mac. I am running data recovery programs on the second mac to ensure that none of the deleted files are overwritten by writes to the file system on my mac.

I've tried a couple data recovery programs (Disk Drill, Data Rescue 3), but they don't seem to be able to recognize .java files.

Has anyone had a good experience recovering deleted .java files on a mac?

Alex Ryan
  • 3,719
  • 5
  • 25
  • 41

1 Answers1

6

Eclipse usually keeps internal history. You should be able to restore the files using Eclipse itself, if the files were deleted in Eclipse: In context menu of you project you should see "Restore from Local History.." item.

On the other hand I would recommend to always use SCM tools (such as Git, Mercural etc). This way you will never lose your code. Practially every SCM tool this days has a very good Eclipse plugin.

Eugene Ryzhikov
  • 17,131
  • 3
  • 38
  • 60
  • Thanks for the answers. Unfortunately the eclipse projects have actually been deleted. However, these suggestions did point to a solution that worked for me ... It seems that Eclipse makes backups of every file that you work on in the following location: .metadata/.plugins/org.eclipse.core.resources/.history/ The files can be manually recovered one by one. Discovered this on stack overflow post: http://stackoverflow.com/questions/969782/eclipses-local-history-where-are-files-saved – Alex Ryan Dec 04 '13 at 19:14
  • 1
    Good to know. Now make sure you use SCM. Even for personal projects. Bitbucket.org is a perfect solution if you need free private repositories. It supports both Git and Mercurial – Eugene Ryzhikov Dec 04 '13 at 19:17
  • 1
    thank you so much!!!! tomorrow is my project deadline and I accidentally deleted a file, you are my savior!!! you saved me et least 2-3 hours of work!!! – orustammanapov Nov 22 '16 at 21:58