Skip to content

Undo

Every file operation in fialr is logged to an append-only audit ledger. The undo system reads this ledger to reverse operations — moving files back to their original locations, clearing provenance metadata, and logging the reversal. Dry-run is default. No file moves without explicit confirmation.

fialr tracks three pieces of provenance for every file operation:

  1. Operations table — the SQLite audit ledger records source path, destination path, operation type, and job UUID for every move, rename, and archive
  2. XATTRsoriginal_name and original_path are stamped on every file before it is moved or renamed
  3. Paths table — the is_current flag tracks which path is the file’s current location

The undo system uses all three to reconstruct and execute the reverse operation.


OperationReversal
MoveFile moved back to original path
RenameFile renamed to original name
Archive (vault)File rehydrated from vault to original path

Enrichment metadata changes, classification assignments, and deduplication groupings are not reversible via undo.


Before executing any reversal, fialr checks for three conflict types:

ConflictCauseResolution
file_existsAnother file occupies the original pathSkip (default) or overwrite with --force
dir_missingOriginal parent directory was deletedSkip (default) or force creates directory with --force
file_modifiedFile content changed since the operationSkip (default) or force moves current version with --force

Conflicts are always surfaced in the dry-run preview. With --force, all conflicts are overridden. Without --force, conflicting operations are skipped and reported.


Always preview first. The default mode is dry-run:

Terminal window
# Show the last 10 reversible operations
fialr undo --last 10
# Preview undo for a specific job
fialr undo --job 2026-03-11_organize_a1b2c3d4

Add --execute to apply the reversal:

Terminal window
# Undo the last 5 operations
fialr undo --last 5 --execute
# Undo a specific job
fialr undo --job 2026-03-11_organize_a1b2c3d4 --execute
# Force through conflicts
fialr undo --last 5 --execute --force

Target individual operations by UUID:

Terminal window
fialr undo --op abc123 def456 --execute

For each operation being reversed:

  1. Source file verified at current location (BLAKE3 hash check)
  2. Conflict check at original location
  3. File moved back to original path
  4. original_name and original_path XATTRs cleared
  5. paths table updated (is_current flags flipped)
  6. Reverse operation logged to operations table

Every reversal is itself logged. The audit ledger remains append-only — undo does not delete the original operation record.