I modified a .txt file and saved it. When I opened it again, I saw that I deleted one thing from the last version I saved. So I would like to know if I can recover what I deleted?

This file is very important to me. You have to help me! My life is on this file.

I didn't delete anything, I only edited the file. When I tried to save I had get an error saying that it could not read some characters so I closed the editor and when I opened it again some lines just disappeared.

  • If your life is on that file, I'm guessing you are now partly dead after deleting part of it? O.o ~The Unicorns. – RolandiXor Jun 27 '11 at 0:40

If you used GEdit and you havent disabled the backup function, then there must be a hidden file with name similar to your file but with ~ appended to it. So if your file name is somefile.txt then look for somefile.txt~ in the same directory. This is the backup file and will give you your files state before last save.

  • How i turn on hidden files? Because i can't see any ~somefile.txt – Rodrigo Graça Jun 26 '11 at 19:58
  • 1
    Control+H or View → Show Hidden Files. – Oli Jun 26 '11 at 19:59
  • Only ....htaccess ;) – Rodrigo Graça Jun 26 '11 at 20:10

binW's solution is the only solution for a problem like this where you have no backup or other versioning software in place. It is a one-time rescue that may help you this one time. If you save again, that backup will be replaced and you lose anything from before that backup. I hope this works for you.

Generally speaking, if you need version control or backup, use backup or version control software. You say this is a critical file so you should treat it like one. Look at version-control tools like git or bzr and RabitVCS to tie them into the normal user interface.

But that is not enough. If this file is as critical to your existence as you suggest, please do some backups once in a while. There's no excuse these days not to. They take (at most) an hour to set up and using tools like DropBox or Amazon S3, are extremely cheap to store quite a lot of data off-site. Take a look at the available backup tools.

Neither of these systems will provide you with complete peace of mind. You want both a VCS for short-term and long-term histories and an off-site backup for long term data integrity.

  • Yhea! I have dropbox and i know that backups is important. I was to make one copy for the coming month. From now i will use Google Docs because i have acess to previous file versions and is on the cloud, so i dont lose it. – Rodrigo Graça Jun 26 '11 at 20:08
  • 2
    Still... Don't rely on that as your only copy. Google had lost user data before. – Oli Jun 26 '11 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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