I have modified a file (personal file) and I saved the modification, now I want to restore the file to its last status before the modification, is it possible? how?
-
Depends on what editor you used to modify the file. Some editors like gedit keep a backup of the last modified file in the same directory. – Chirag Bhatia - chirag64 Jun 17 '14 at 12:06
-
its fedora 18 spherical cow, and the editor is geany – MD.MD Jun 17 '14 at 12:10
3 Answers
Which distro?
I mean if you are using gedit text editor and you have backup option turned on it then go to the directory of your file and switch to "show hidden files and folders" and there should be a backup. for example if the file name is 1.txt, backup would be 1.txt~. It will contain the stuff before the last save,

- 114
- 1
- 9
As far as I know, Geany does not keep a backup of files by default while saving, so your file changes are probably lost.
Geany however does have a plugin which can do this for you in future. You can enable the Save actions plugin and enable the Backup copy option in it.

- 4,430
- 3
- 26
- 35
If you have just overwritten the file (Ctrl+S) and haven't yet quit Geany, you can just Ctrl+Z to the desired document state and save that file version.
If you have already quit Geany after that and haven't set up back up in Geany before, I am afraid that by means of Geany you cannot restore the file to the previous state.
Read this article about how to set up back up in Geany. Basically you can go to Edit -> Preferences -> Various (read the manual and the link above before changing these preferences) and:
- disable
use_atomic_file_saving
(disabled by default) - enable
use_gio_unsafe_file_saving
(enabled by default) - enable
gio_unsafe_save_backup
(disabled by default)
- disable
This will always keep the previous version of the file (as a hidden file with ~
attached to its name) next to original.
Or you can install/enable the Save Actions Geany plugin and enable the Auto Save and Backup Copy options to automatically save files at a certain time interval and to keep a copy of previous file versions.

- 667
- 6
- 14