| name | rollback-snapshot |
| description | Use when the user wants to revert a subvolume to a prior snapshot. |
Rollback Snapshot
Restore a BTRFS subvolume to a previous snapshot.
When to use
- Undoing a system change (config, package, file edit)
- Reverting after an unsuccessful upgrade
- Emergency restore from a known-good state
Inputs to gather
- Snapper config name
- Source snapshot ID (the state to roll back to)
- Target snapshot ID (usually 0 for current)
Procedure
- Preflight: Verify
snapper is installed and config exists. Warn if rolling back root filesystem (requires reboot).
- Run
sudo snapper -c <config> undochange <src>..<tgt> in dry-run mode (list affected files).
- Display the list of files that will be reverted. Request explicit user confirmation.
- On confirmation: Run
sudo snapper -c <config> undochange <src>..<tgt> (destructive mode, no flag).
- If root filesystem: print reboot reminder.
Output / side effects
Subvolume reverted to snapshot state. May require reboot if root filesystem.
Safety / constraints
Destructive operation. Always show dry-run listing first. Requires explicit confirmation. Root-FS rollback warns about reboot. Requires sudo.