Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from Apr 18 '10 at 22:14

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

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
Ubuntu is NOT UNIX :) – Tim Post Apr 20 '10 at 12:20
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, 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
@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

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).

share|improve this answer

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

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

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

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .