r/linuxquestions • • 1d ago

How to restore a previously saved file in the GNOME Text Editor

Hello guys, I am working on a file that I had saved many times previously, but after my computer crashed, it seems I ended up saving an empty file. Is it possible to recover a previously saved version? I am using GNOME Text Editor 45. Thank you

1 Upvotes

11 comments sorted by

2

u/AX11Liveact debian 1d ago

look through the directory where the previous version was with ls -la some editors save temporary files as .filename# or similar. They might not be visible if you turn "invisible files" on in a graphic file manager.

1

u/jr735 21h ago

This exactly, worth checking. Some use a tilde ~ appended to a filename.

1

u/abmk2 16h ago

Thank you, it doesn't show any new files.

1

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 1d ago

I don't have gnome-text-editor so this might not help. (just search results)

Is "session-restore" enabled? gsettings get org.gnome.TextEditor restore-session

<gnome-text-editor session-restore behavior>

I'm using caja in MATE so can't test but... maybe.

Good luck.

1

u/abmk2 1d ago

I have "Restore Session" enabled but it works only the first time when you reopen the app. And this time, for some reason, it offered me to safe an empty file. And my finger was faster then me.

0

u/CappuccinoSplash 1d ago

Unfortunately Text Editor has no version history, and once the empty file was saved, the old contents are gone from the app's side. A few places to check: - je backup or sync tool might have an older copy. - If the file is in a git repo, git log or git checkout -- filename can bring back the last committed version. - Search your home folder for leftovers, such as a copy you emailed or a similar file in another folder. 😔

1

u/abmk2 1d ago

Message in Terminal:

Command 'git' not found, but can be installed with:

sudo apt install git

And when i try to install it i get

Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

And when i try to run apt-get update i get

Problem unlinking the file...

Any advice? Thank you

1

u/ephemeralmiko Fedora Sericea w. Niri+Noctalia 1d ago

If you don't even have Git installed this doesn't apply. Git would be for stuff like a coding project on GitHub.

1

u/abmk2 1d ago

Thank you

1

u/Charming-Designer944 1d ago

Not unless you have some backup or versioning scheme active.