Skip to content

Restoring Files With Borgmatic

Reviewed in November 2026

If you already use Borgmatic for your backups, it may be easier to use Borgmatic syntax for restoring.

You should already have Borg and Borgmatic installed and know how to use the command line. If you haven’t installed Borg yet, have a look at the command line setup guide. Refer to the official Borgmatic documentation for setting up Borgmatic. If your repository is hosted on BorgBase, your config file can be automatically generated using the Setup Wizard.

Borgmatic automatically uses the repository and passphrase defined in the config file, so they don’t need to be specified again.

Assuming that you have Borgmatic configured and making backups, first find the right archive (often called a snapshot or version) to restore by listing them:

Terminal window
borgmatic repo-list

After choosing the right archive, you can view files contained in it. With Borg 2, archives of a series share the same name, so pass the archive ID shown in the first column or latest to --archive instead:

Terminal window
borgmatic list --archive server-2020-04-01

Or look only at files in a specific archive and folder:

Terminal window
borgmatic list \
--archive server-2020-04-01 \
--path var/www/example.com

Make sure you are in the directory you would like to restore to, as Borgmatic extracts the files into the current working directory.

If you would only like to restore a particular directory from a backup, it’s as easy as adding --path with the directory or file you would like to restore (minus the leading /). To extract into a folder other than the current one, add --destination $SOME_FOLDER (the folder must already exist).

For example, if you would like to restore only /mnt/catpics from the same archive, the full command is:

Terminal window
borgmatic extract \
--archive server-2020-04-01 \
--path mnt/catpics \
--destination /mnt/new-directory

This restores the full path of that particular directory, but only includes that directory.

If you already keep your Borg settings in Borgmatic, you should also use it to extract backups. For more details, see the official Borgmatic documentation.