CLI · Guides
Undo what a turn changed
Restore the files TALOS changed, from checkpoints kept outside your repository, and apply them again if you change your mind.
Checked on CLI 0.6.12
A newer version is out (CLI 0.6.18): some details may differ.
Before TALOS changes a file, it takes a checkpoint. Checkpoints are kept outside your repository and outside Git: your history is never touched.
In the interactive screen
Section titled “In the interactive screen”/undo — also /rewind or /checkpoint — opens Go back to an earlier point: the checkpoints of this conversation,
each with the files that changed since it and would go back. Pick a point, then choose what goes back:
- Enter — the code and the conversation;
- c — the conversation only;
- f — the files only.
Going back first saves a checkpoint of the present, so you can return to it. When a turn ends, its last line names its checkpoint: Checkpoint · 1 file: src/retry.mjs (modified) · /undo goes back.
From the shell
Section titled “From the shell”talos checkpoint list # the checkpoints of the project, newest firsttalos checkpoint show <id> # what it covers: operation, state, files covered and files excludedtalos checkpoint undo # restore the files as they were before the latest checkpointtalos checkpoint redo # apply again what the latest undo removedundo and redo take a checkpoint id to act on an older one.
Before you restore
Section titled “Before you restore”A checkpoint records the operation it was taken for — an edit, a shell command — and lists the files it covers and those
it excluded. Read them with talos checkpoint show before you restore; /diff shows the current Git diff of the project.