Emacs produces a backup of each file by default. It does this by
appending a tilde to the file's name. For example, Myfile.txt is backed up to
Myfile.txt~. It's a reasonable strategy, assuming that
a Version Control system is in place.
But in the absence of version control, you're limited to restoring just the previous version; older versions need to be restored from backup.
I use git for coding projects that I share to the public. But I
didn't create a repository for my home directory. So when
C-c a m TAG1 generated an error instead of a list of
TAGged items, I hoped fervently that the latest init file change was
to blame.
After finding and fixing the problem quickly, (and realizing I was lucky this time), I resolved to be more diligent about disaster recovery. I looked into what backup schemes Emacs already provides.
Emacs can create unique backups for a file rather than overwriting the previous backup. When Emacs sees a numbered backup for a given file, it will make a new, sequentially-named file for each backup of that file, while continuing to use the "append tilde" method for other files.
Once I renamed (or copied) .emacs~
to .emacs.~1~, Emacs created backups
named .emacs.~2~, .emacs.~3~ (and so on).
I didn't even need to change a variable -- when Emacs
detected .emacs.~1~, it knew that backups
of .emacs needed to be numeric, so it acted
accordingly. Emacs continues to use bills.org~ as the backup
for bills.org. Until I tell it otherwise.
Read the Emacs Manual to learn more about numbered backups.
1 C-c a m invokes org-tags-view
The default values for the pertinent backup variables are:
make-backup-filesis tbackup-by-copyingis nilversion-controlis nil








![Screenshot of a small part of author's Emacs frame. It shows the title as [1:00] (Pay Medical Bills). Below that is the menu and the first three lines of author's Org file.](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFNyCR7wNhE7OWS_SXA_uLC2am3qYCtmfYDNH5xTyQX0BNV-oBjPc38n2YX6i3_FToGd26IlzITVpwBJa14DkhAI_iW_oCjUxsnwQcYYnWyOfcIg8itUJK7DMOVJkVtUr-HbMPgXudvivO-0vIyMJSUWP4z_IPecQdr0xEwiUveuahC81Js3BpO5WO5xc/s320/org_clocked_task_in_titlebar.gif)
