File Rewind

File Rewind lets you go back in time with the files in a folder. Every so often it takes a checkpoint: a saved copy of every file in the folder as it is at that moment. If you later delete a file by mistake, save over a good version, or make changes you regret, you can bring back the file, or the whole folder, exactly as it was at any checkpoint.

Taking a checkpoint never changes your files. Bringing files back is always safe too: what you had just before is saved first, so you can change your mind.

File Rewind is not a backup. Checkpoints are kept on the same disk as your files. They protect you from mistakes, but if the disk breaks or the computer is lost, the checkpoints are lost too. Keep a copy of important files on another drive as well.

Contents

Getting started

  1. Click Choose a folder… and pick the folder you want to protect, for example Documents or Pictures. Everything inside it, including the folders inside it, is protected.
  2. Click Create the first checkpoint. For a big folder this can take a few minutes, and it needs about as much free disk space as the folder itself (File Rewind warns you first if the folder is large). Later checkpoints are much quicker and only use space for what changed.
  3. Leave Save a checkpoint every day checked when creating the first checkpoint to turn on daily protection. You can change the frequency later at the bottom of the window. See Automatic checkpoints.
  4. Work on your files as usual. Before a big change, click Create checkpoint… as well.

You can protect as many folders as you like. Use Change folder at the top of the window to switch between them.

Some folders, such as the system settings in /etc, belong to the administrator. For those, File Rewind asks for the administrator password whenever it needs to look at or change the folder. The filesystem root (/) and system areas like /proc, /sys, /dev, /run and /tmp can't be protected.

The main window

When something finishes or goes wrong, a coloured message appears at the top of the window. After a restore, it has an Undo button.

Creating checkpoints

Click Create checkpoint… (or press Ctrl+S) and give it a name that will mean something to you later, such as “Before rewriting chapter 3” or “Tax return finished”. The name is optional; checkpoints always show the date and time.

A checkpoint is only made when something changed since the last one. If nothing changed, you are told so and nothing is added.

To save only some of your changes: select Now, tick the files you want to save, then click Create checkpoint… and tick Only save the checked files.

Automatic checkpoints

Choose how often File Rewind should take a checkpoint on its own, using Automatic checkpoints at the bottom of the window:

Every hourat the start of every hour
Every dayonce a day while the computer is on, including after a missed day
Every weekevery Monday at 12:30
When the computer startseach time the computer is switched on

As with checkpoints you make yourself, one is only made when something changed, so this does not waste space. For daily checkpoints, File Rewind checks every 15 minutes whether one is due. If the computer has been off for several days, one checkpoint saves the current changes. If the folder is unavailable, File Rewind tries again after an hour. Hourly and weekly checkpoints need the computer to be on at the scheduled time. You don't need to keep File Rewind open.

Automatic checkpoints are marked automatic in History. If they crowd the list, untick Show automatic checkpoints under History to see only the ones you made yourself. Hidden checkpoints are still kept.

How do I…?

…get back a file I deleted or changed by mistake?

  1. In History, select a checkpoint from before the mistake.
  2. Find the file in the list. A deleted file shows as Deleted since then; a changed one as Changed since then.
  3. Tick the box next to it (you can tick several) and click Restore checked files.

If you are not sure which checkpoint has the version you want, use Find a file instead: it shows every version of one file.

…exclude a file from future checkpoints?

Select Now, right-click the file in the changes list, and choose Exclude from future checkpoints…. File Rewind keeps the file on disk and adds its name to .gitignore in the same folder. If the file was already tracked, the next checkpoint of the whole folder records its removal. Earlier checkpoints keep their copies. In an existing Git project, this also stages the removal for the next commit. To change your mind right away, click Undo in the message that appears. Later, to include the file again, remove its rule from .gitignore and create a checkpoint of the whole folder. Git also applies these rules in any enclosing project or in projects configured to use this .gitignore as their global ignore file.

…throw away the changes I made since the last checkpoint?

Select Now. The list shows what you changed since the last checkpoint. Tick the files and click Restore checked files to put just those back, or click Restore whole folder… to put everything back as it was at the last checkpoint.

…put the whole folder back as it was on a certain day?

Select that checkpoint in History and click Restore whole folder…. File Rewind shows what will happen and asks you to confirm. Afterwards the folder is exactly as it was then: changed files get their old content back, deleted files return, and files that did not exist yet are removed (they are kept in the checkpoint that is saved just before, so you can still get them back).

…find a file when I don't know when it changed?

Click Find a file… under History (or press Ctrl+F) and type part of its name. Every file that was ever in a checkpoint is found, including files that were deleted since. Choose one and click Show versions….

The versions window lists each checkpoint in which that file was different. Select a line, then Open this version to look at it, Save as… to keep a copy under another name, Compare with now… to see what is different, or Restore this version.

You can also right-click a file in the list of changes and choose Show all versions of this file….

…look at an old version without changing anything?

Select the file in the list and click Open checkpoint version. A read-only copy opens in the usual program for that kind of file; your current file is not touched. To keep the old version next to the current one, right-click the file and choose Save checkpoint version as….

For a changed text file, Compare… shows the lines that are different: lines marked − are only in the checkpoint, lines marked + are only in the file as it is now.

…undo a restore?

Right after a restore, click Undo in the message at the top of the window. If the message is gone, look in History: just before every restore, your files are saved in a checkpoint marked saved before a restore. Select it and restore from it like any other checkpoint.

…get back a folder that was deleted?

Checkpoints are kept outside the folder, so they survive when the folder is deleted. Click Change folder; the folder is listed with (missing) after its name. Choose it, select a checkpoint and click Restore whole folder….

What the words in the list mean

When you select Now, the list compares your files with the last checkpoint. When you select an older checkpoint, it compares your files now with that checkpoint, which is why the words end in “since then”.

ChangedThe file is in both, but its content is different.
NewThe file exists now, but did not exist at the checkpoint. Restoring the whole folder removes it.
DeletedThe file was there at the checkpoint, but is gone now. Restoring brings it back.
Permissions changedThe content is the same, but who may read or change the file is different.

In History, checkpoints are marked by how they were made: no mark for the ones you made yourself, automatic, saved before a restore, and restore for the state right after a restore.

Messages you may see

“Not everything could be saved”

A checkpoint was made, but some files are missing from it. Click Show all to see which ones and why. The usual reasons are:

Everything else was saved normally. If the missing files matter, fix their permissions or keep them somewhere else. Automatic checkpoints keep reporting this until it is solved.

“Something went wrong”

The action did not happen, and nothing was lost. Show Details has the technical explanation, which is useful if you ask someone for help.

The administrator password is asked

The folder belongs to the administrator (see Getting started). If you cancel, nothing is changed. For such folders, the window does not refresh on its own; click ⋮ → Refresh or press F5.

“Some folders could not be checked”

File Rewind could not look inside some folders, so changes in them are not shown. The rest of the list is correct.

Reminders

When you log in, File Rewind checks your protected folders. If a folder has changes that are not in a checkpoint and its last checkpoint is at least a week old, a notification offers to Save checkpoint now (in one click, without opening the program) or to open File Rewind. You get at most one reminder a day.

To turn reminders off, click ⋮ and untick Remind me about unsaved changes. Automatic checkpoints make reminders mostly unnecessary.

From the file manager

Right-click a file or folder and choose Earlier versions (File Rewind). In Thunar it is under Send To. For a file in a protected folder, its list of versions opens straight away.

What is not saved

To keep checkpoints small, these are left out on purpose:

Empty folders are not kept either: a folder comes back when a file in it does.

Moving folders and USB drives

Checkpoints belong to a folder's location. If you rename or move a protected folder, File Rewind sees it as a new folder with no checkpoints. The old checkpoints are not lost: the old name is listed in Change folder with (missing). To use them again, move or rename the folder back.

A folder on a USB drive can be protected too; its checkpoints are kept on the computer, not on the drive. Plug the drive in before you open the folder, or File Rewind will report it as missing. While the drive is unplugged, no automatic checkpoints are made.

Disk space and deleting checkpoints

The space checkpoints use is shown under the folder's status line. Files that did not change are stored only once, so many checkpoints of a folder usually take much less space than many copies of it.

Single checkpoints can't be deleted, so that your history can always be trusted. To remove all checkpoints of a folder, click ⋮ → Delete all checkpoints of this folder…. This also turns off its automatic checkpoints. Your files are not touched, but you can no longer go back to earlier versions.

Checkpoints of your own folders are kept in ~/.local/share/file-rewind (a hidden folder in your home folder). Checkpoints of administrator folders are kept in /var/lib/file-rewind, readable only by the administrator. A folder that already has a hidden .git folder (because an older version of this program protected it, or because it is a Git project) keeps its checkpoints there.

Keyboard shortcuts

Ctrl+SCreate a checkpoint
Ctrl+FFind a file
Ctrl+OChoose a folder
F5Refresh
F1This help
Ctrl+QClose

For experienced users

File Rewind uses git. Each folder's checkpoints are a git repository (named after the folder plus a hash of its path) whose working tree is the folder; file permissions are recorded alongside. Restores never rewrite history: they add new commits, so every earlier state stays available.

If the folder already contains a .git directory, that repository is used as it is: its existing commits appear in History, checkpoints are new commits on the branch that is checked out, and its ignore rules apply. Git skips untracked files that match rules in .gitignore.

Automatic checkpoints are cron entries running file-rewind --auto-checkpoint folder, in your crontab or, for administrator folders, in /etc/cron.d/file-rewind. The command prints nothing when all went well, and exits with 1 if the checkpoint failed, 2 if it was saved without some files, and 3 if none was needed but some files could not be saved.