Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In GNU/Linux. Ubuntu Jaunty. I did something stupid, where is the undo command?

share|improve this question

migrated from stackoverflow.com Apr 18 '10 at 22:14

This question came from our site for professional and enthusiast programmers.

11  
go back in time and create a source code repository that you conscientiously check in all your revisions to. –  intuited Apr 18 '10 at 23:16
1  
Ubuntu is NOT UNIX :) –  Tim Post Apr 20 '10 at 12:20
add comment

5 Answers

up vote 4 down vote accepted

There is no "undo" option. Find a data recovery program and don't write anything to disk to avoid overwriting the files.

share|improve this answer
1  
+1, but even just firing up a browser to search for one is likely wiping out at least a few of them :) –  Tim Post Apr 20 '10 at 12:21
1  
@Tim I wouldn't say it is likely to wipe out a few of them, unless the drive is completely at capacity. The possibility is very real though. –  Goyuix Apr 20 '10 at 14:43
add comment

I found this page a while ago and (fortunately) haven't needed to use it. It's a bit verbose but apparently there is a way to undelete files from the ext3 filesystem (standard on jaunty).

http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html

share|improve this answer
add comment

First things first! Boot into single user mode and remount the drive in question read-only. This will pervent any further damage you might cause. When you do that, the crisis is averted and you can use any one of a number of methods to undelete. None of them is guaranteed to work, as your sources are marked as deleted on the filesystem, and Linux may have overwritten them with something else already.

I did do that once. I deleted an entire project that had no recent backup. And the undelete tool I tried wasn't able to discovered the deleted files. Cue many hours of panicked scrolling through a many-GB HDD image in PICO. I kept pagedown and looked for something that isn't gibberish. Eventually I reached my project files which were almost intact and thankfully were residing nearby each other on the HDD image.

share|improve this answer
add comment

After rebooting to single user mode and remounting the drive to read only you can grep the entire /dev/sdXX for the file headers or anything else you know was in the file. This is basically what all ext3 file undeletion programs do.

share|improve this answer
add comment

If you did this command in your Console application, there is no way to undo what you just did. Sorry! :(

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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