Skip to main content

Restore Files and Directories

Quick Summary

Restic restores data into a target directory. In most cases the safest workflow is:

  1. restore into /restore/...
  2. inspect/validate
  3. copy/promote into the live location

Prefer restoring into a staging path first, then copy/promote the recovered files after you confirm they are correct.

Safe Restore Rule

Do not restore directly into a live production directory unless you have a clear rollback plan. Restore to /restore/... first, verify, then apply the changes.

How Restic Chooses What to Restore

You specifyExampleMeaning
Snapshotlatest or snapshot IDwhich point-in-time to restore
Target--target /restore/labwhere restored files will be written
Filters (optional)--include "/srv/app/config"which paths from the snapshot

Restore Latest Snapshot

restic restore latest --target /restore/lab

After restore, inspect what you got:

ls -la /restore/lab
tip

If you are restoring a service, restore into a new directory and point the service at it first (if possible).

Restore a Specific Snapshot

restic snapshots
restic restore 3f1a7c4b --target /restore/snapshot-3f1a7c4b

Find a Snapshot by Tag/Host (Common)

restic snapshots --tag daily --host app-01

Restore Only Selected Paths

restic restore latest \
--target /restore/lab \
--include "/srv/app/config" \
--include "/srv/app/uploads"
note

The --include paths refer to the original paths from the backup. They are restored under your --target directory.

Common Mistakes

MistakeWhat happensFix
Restoring into the wrong placedata lands somewhere unexpectedalways use explicit --target
Restoring without checking snapshotswrong restore pointfilter with --tag/--host first
Restoring directly into live directoryoverwrite production staterestore to /restore/... then promote
tip

Use explicit restore targets like /restore/<ticket-id>/ so recovery steps remain auditable.

What's Next