tine rewind
v0.22 adds working-tree restoration from recorded write actions. This is distinct from forking a run or replaying model calls. It cannot reconstruct file history that the artifact did not retain.
# Dry run: target the state before the run
tine rewind run.tine --json
# Dry run: target the state immediately after step index 3
tine rewind run.tine@3 --root . --json
# After reviewing the plan and backing up local changes, explicitly write
tine rewind run.tine@3 --root . --apply --jsonTargets and recoverability
RUN[@STEP] accepts a step index or step ID. Without a step, the target is before the run; with one, it is immediately after that step. Whole-content Write actions can be replayed forward. Edit, MultiEdit, and str_replace operations are applied forward or undone backward only when inserted text occurs exactly once.
Shell-command and patch changes, redacted file history, and whole-file creation without prior-state evidence can be unrecoverable. The plan reports reasons instead of guessing. Do not treat rewind as a full filesystem snapshot or a replacement for backups and version control.
Apply deliberately
The default is a dry run. --apply writes files atomically beneath --root, which defaults to the current directory. Paths outside the root or through symbolic links are refused. If a file is neither in the run's last recorded state nor already at the target, a conflict prevents writes and exits 1 unless --force overrides that conflict check.
Force can overwrite later local edits. It does not invent missing content or make refused paths safe. Review the plan and preserve uncommitted work before applying. Individual file writes are atomic; do not infer a filesystem-wide rollback transaction.
Machine-readable review
--json emits restore, unchanged, conflict, unrecoverable, and refused lists. Use these categories to decide whether the plan is appropriate rather than assuming every changed file can be restored.
See the upgrade guide, run forks, and replay modes.