7

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.

Isaiah
  • 59,344

3 Answers3

10

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.

htorque
  • 64,798
binW
  • 13,034
8

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.

Oli
  • 293,335
  • 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
  • I think would be a good idea to offuscate /etc text-plain files and be able to versioning it on local machine ... – Luiz Carlos Mar 25 '23 at 10:47
-1

This saved my life, while I was using Google Drive (insync / non-free).

  • Enter Google Drive in the web browser; right-click on the file;

  • Click "Manage versions" (File lasts 30 days in google drive server or max. 100 versions);

  • Download the version of interest

Ferroao
  • 850