Video Lesson: Rewind a coding session in Claude Code

Rewind a coding session in Claude Code

Claude Code’s `/rewind` command undoes conversation and code changes, restoring earlier coding session checkpoints.


Lesson Content

Ever made a mistake in your prompt, or need to undo changes that Claude Code just made within the current conversation? The /rewind command allows you to do just this, reversing either your conversation or code, or both, to an earlier point in time. You can think of it as a quick undo button for your entire coding session.

Use /rewind for quick rollbacks

Type /rewind to see your recent conversation history. Select where you want to go back to, and you'll be given a handful of options for what to do next.

You can select "Restore code", which puts all of your files back to where they were before any modifications in the conversation were executed, all while keeping the conversation alone. You can also select "Restore conversation", which rolls back the current conversation to an earlier point in time, but leaves all of the files as they are. Or, you can select "Restore code and conversation" to restore both.

This works great when Claude makes a sweeping change that you don't really like, and you'd like to try a completely different approach without starting the entire conversation completely over.

Keyboard shortcut to rewind

You can also rewind something directly from the prompt. If you've already typed something out, you can tap the Esc key twice to clear out what you've written. Once your prompt is blank, you can also double-tap the Esc key again to quickly navigate to previous points in your conversation. Then, use the up and down arrows to select where you want to restore, and pick one of the options.

This works exactly like /rewind, letting you jump back to any checkpoint in your coding session.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Log in for AI tutor access.

Comments

Join the discussion!

Notes

Keep track of what you learn!