Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I have a Java Project (Oauth ,this is its name), and I worked on Ubuntu 12.10

And I delete it from eclipse (delete it from disk...)

This is a important Project for me .

Can anybody else tell me how can I recovery my Java Project .

share|improve this question

marked as duplicate by Thomas W., green7, Seth, Eric Carvalho, Kevin Bowen Apr 12 '13 at 4:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4  
Possible duplicate: askubuntu.com/q/3883/83046 –  green7 Apr 11 '13 at 15:46
add comment

2 Answers 2

So you've lost some source files? No problem, you can recover the last checked in version from git just by doing a git checkout.

$ rm README ChangeLog 
$ git checkout
D   ChangeLog
D   README
$ git checkout .
$ ls -l README ChangeLog 
-rw-rw-r-- 1 kaz kaz 15445 Apr 11 11:46 ChangeLog
-rw-rw-r-- 1 kaz kaz  4756 Apr 11 11:46 README

What, no version control? Ah, but you keep backups, of course. Go to the backup disk, and get yesterday's version from the nightly snapshot.

Oops, no backups either? You are probably screwed then.

There is no reliable way to undelete files. There are utilities which give a "best effort", without guarantees. Once you delete a file, the blocks which it occupied can be immediately recycled for another use.

Even installing extundelete could, ironically, overwrite the files.

After accidentally deleting something for which there is no backup, I would immediately unmount the hard drive (or power of the machine, really) to stop all destructive disk activity ASAP. Then use another system to mount that drive and try to recover the files. I would either boot into another partition of the same machine, or physically remove the drive, pop it into my handy USB external drive enclosure, and mount it on another Linux system to do the recovery.

In the future, use version control and keep backups. If your hard disk died today, what would happen to your other projects?

share|improve this answer
    
Even though this isn't a real answer +1, it amazes me that people actually computer literate enough to program don't at least think to back up. –  handuel Apr 11 '13 at 19:45
    
This is as real an answer as you can get. If an answer means "guaranteed step by step procedure to solve the problem of the files being gone", then there is no answer (other than writing the code all over again). –  Kaz Apr 11 '13 at 19:48
add comment

You can try to install extundelete via the software center. If that is not working you will need to recover the lost files the hard way, some call the process data carving. Basically you run a tool like foremost to search your whole disk for pattern of lost files. Have a look here https://help.ubuntu.com/community/DataRecovery

share|improve this answer
    
The act of installing extundelete could well wipe over the files. –  Kaz Apr 11 '13 at 18:48
1  
True, ideally you switch off the system, take a disk image and work only on that. –  Ruediger Apr 11 '13 at 19:12
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.