undo
fialr undo [options]Reverse previous file operations. Shows a dry-run preview by default. Supports undoing by job, by operation count, or by specific operation UUIDs.
Options
Section titled “Options”| Option | Description |
|---|---|
--job UUID | Undo all operations from a specific job |
--last N | Undo the last N operations |
--op UUID [UUID ...] | Undo specific operation UUIDs |
--execute | Apply the undo (default: dry-run preview) |
--force | Force undo even when conflicts are detected |
What it does
Section titled “What it does”Dry-run (default)
Section titled “Dry-run (default)”Without --execute, undo previews what would be reversed. Each operation shows the current path and the original path the file would return to. Conflicts are flagged with a reason.
Conflict detection
Section titled “Conflict detection”Before executing, undo checks for three types of conflicts:
| Conflict | Description |
|---|---|
file_exists | Another file now occupies the original path |
dir_missing | The original parent directory no longer exists |
file_modified | The current file hash differs from the operation record |
Conflicts are displayed in the dry-run preview. With --force, conflicting operations proceed anyway (overwriting files at the original path). Without --force, conflicting operations are skipped.
Execution
Section titled “Execution”With --execute, for each reversible operation (in reverse chronological order):
- Verify the file exists at its current location
- Check for conflicts at the original location
- Move the file back to its original path
- Clear provenance XATTRs (
original_name,original_path) - Update the
pathstable (flipis_currentflags) - Log the reverse operation to the
operationstable
Reversible operations
Section titled “Reversible operations”Only move, rename, and archive operations can be reversed. Enrichment metadata changes and classification assignments are not reversible via undo.
Output
Section titled “Output”Dry-run preview:
undo --last 5
UNDO 5 operations (dry-run)──────────────────────────────────────────────────────── financial/2024-03-15-acme-invoice.pdf → Documents/scan001.pdf
financial/2024-01-08-smith-contract.pdf → Documents/doc (1).pdf
photos/2024-06-01-paris-eiffel_sunset.jpg → Photos/IMG_4521.jpg
⚠ CONFLICT file_exists medical/2023-11-20-dr_chen-annual_physical.pdf → Documents/results.pdf (file exists at original path)
financial/2024-09-12-fidelity-401k_statement.pdf → Documents/statement.pdfExecution:
undo --last 5 --execute
UNDO 4 reversed, 1 skipped──────────────────────────────────────────────────────── reversed 4 skipped 1 (conflict: file_exists)Examples
Section titled “Examples”# Preview the last 10 reversible operationsfialr undo --last 10
# Undo a specific jobfialr undo --job 2026-03-11_organize_a1b2c3d4
# Undo specific operations by UUIDfialr undo --op abc123 def456
# Execute the undo (apply changes)fialr undo --last 5 --execute
# Force undo even with conflictsfialr undo --last 5 --execute --force
# Show all reversible operations (no filter)fialr undoSee also
Section titled “See also”- Job Execution Model — how operations are tracked
- organize — operations that can be undone
- rename — rename operations that can be undone