Rewind to an earlier message
Go back to before a message you sent, taking back the code, the conversation or both.
Press esc twice with the prompt empty, or type /rewind, to go back to before a message you sent. With text in the
prompt, esc twice clears it instead. Rewind waits for the turn to end; esc once interrupts it.
The panel lists your messages, newest first. Under the one you're on, it shows what going back would change in files.
+- Rewind 3 messages ----------------------------------------------------------------------+ | > 1. add a test for the window reset | | 2 files change +29 -1 | | src/middleware/rate-limit.test.ts, src/middleware/rate-limit.ts | | 2. use the existing TooManyRequests error | | 3. add rate limiting to the api | +------------------------------------------------------------------------------------------+ | Enter pick · Up/Down move · Esc cancel | +------------------------------------------------------------------------------------------+
A message you sent while the agent was working joined that turn, so it isn't listed.
Press enter on a message, then pick what to take back:
+- Rewind to before add a test for the window reset ---------------------------------------+ | 2 files change +29 -1 | | src/middleware/rate-limit.test.ts, src/middleware/rate-limit.ts | +------------------------------------------------------------------------------------------+ | > 1. Restore code and conversation | | Files go back, and the conversation goes on from before this message, which goes | | back into the prompt | | 2. Restore conversation | | The conversation goes on from before this message; the files stay as they are | | 3. Restore code | | Files go back; the conversation goes on as it is | | 4. Never mind | | Back to the messages | +------------------------------------------------------------------------------------------+ | Enter rewind · Up/Down move · Esc back | +------------------------------------------------------------------------------------------+
| Choice | What happens |
|---|---|
| Restore code and conversation | Files and the conversation go back; your message returns to the prompt to edit and send |
| Restore conversation | The conversation goes back; files stay as they are |
| Restore code | Files go back; the conversation goes on |
| Never mind | Back to the list |
When no file changed since that message, only Restore conversation and Never mind are offered.
Only changes made through the file tools come back. Changes made by commands, such as a git checkout, stay.