HEDDLE

CLI reference

heddle undo

Shipped
heddle undo [OPTIONS]

Undo the last Heddle operation. Thread-local: it only rewinds operations recorded from the current checkout.

Output text (default) · json

heddle undo is thread-local. It rewinds operations recorded from the checkout you run it in, so to unwind work an agent did in an isolated thread, run it from that thread's checkout — not from the origin.

It also refuses to touch your files unless you ask. Without --hard, an undo that would rewrite the worktree refuses before changing repository state or files. --recover goes the other way: it restores the checkout-local state preserved by the most recent undo as worktree changes, leaving HEAD and the current thread alone. --redo re-applies what a prior undo rewound.

--list shows recent operations without undoing anything, which is the right first call when you are not sure what the last operation was.

Undoing a redaction is a separate, explicit opt-in: --allow-redact-undo. The inverse of a redaction removes the redaction record, so previously-hidden bytes become readable again; without the flag a chain that crosses a Redact refuses loudly rather than silently re-exposing content. It is refused regardless of the flag once a purge has destroyed the bytes — purge is irreversible.

Flags

--steps <n>, -n <n>
Undo N operations. default: 1
--list
List recent operations without undoing.
--depth <n>
Number of batches to list. default: 20
--preview
Preview operations without undoing. --dry-run is an accepted alias.
--hard
Permit undo to rewind worktree files. Without this explicit opt-in, an undo that would rewrite the worktree refuses before changing repository state or files.
--redo
Re-apply operations that a prior undo rewound.
--recover
Restore the checkout-local state preserved by the most recent undo as worktree changes. HEAD and the current thread remain unchanged.
--allow-redact-undo
Explicit opt-in for undoing a redaction. Refused regardless of the flag when a purge has destroyed the bytes.

Examples

Look before you rewind

bash$ heddle undo --list$ heddle undo --preview# run this in the checkout you want rewound — undo is thread-local

See also