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.
Prerequisites
Section titled “Prerequisites”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.
Step 1 – Listing Archives and Files
Section titled “Step 1 – Listing Archives and Files”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:
borgmatic repo-listAfter 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:
borgmatic list --archive server-2020-04-01Or look only at files in a specific archive and folder:
borgmatic list \ --archive server-2020-04-01 \ --path var/www/example.comStep 2 – Extracting Files
Section titled “Step 2 – Extracting Files”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:
borgmatic extract \ --archive server-2020-04-01 \ --path mnt/catpics \ --destination /mnt/new-directoryThis restores the full path of that particular directory, but only includes that directory.
Conclusion
Section titled “Conclusion”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.