Back to Blog
7 min
technical

Claude God Tip #7: A Special Kind of Disaster Management in Claude Code

Pressed Escape twice by accident and discovered Claude's rewind command. Here's how to undo AI mistakes and restore your code to any checkpoint.

Claude CodeCLI ToolsDeveloper ProductivityWorkflow OptimizationGitDisaster Recovery

Claude God Tip #7: A Special Kind of Disaster Management in Claude Code

Published: November 24, 2025 • 7 min read

Welcome to another episode of Claude God tips. This one is a small tip but I believe a very useful one. I actually came across this by accident.

How I Discovered This Feature

Because of how quickly the end of my SDR Era is approaching (19 more days, ahhh), I am usually working on multiple things at a time. I could be writing on one window, planning a new application on another window, implementing changes to an app on another window, and then building a whole new application from scratch on yet another. The thing though is that I am learning that my current laptop does not exactly like what I am putting it through, and it vocalizes that by slowing down or lagging.

Just yesterday, I sent a prompt to Claude and saw that it was about to go down a path of hallucination, so I knew I had to interrupt the session with the Escape key. Except this time, I pressed the Escape key more than once because my computer was lagging.

This mistake apparently activated a slash command: the /rewind command.

And in this blog post, we're going to learn all about it.

What Are Slash Commands?

First, what are slash commands in Claude Code?

Go to Claude in your terminal and type the forward slash /. You should see a list of different "commands" that you can execute. These essentially control Claude's behavior during an interactive session.

There are a lot of them, and when we looked at creating subagents in this blog post, we learned how to create agents using the /agents slash command.

Now the /rewind command? I like to see it as a disaster management command.

What the Rewind Command Does

Every time you send a prompt to Claude, that prompt creates a checkpoint.

Think of it like this: every time you send a prompt, you can compare it to committing a change on GitHub. Then when you activate the rewind command, it opens a window with a list of all the "commits" (in this case, prompts that you have sent) and provides you an option to revert back to a previous checkpoint.

The flexibility here is that you can choose to revert just the conversation, or the conversation AND the code.

How to Activate the Rewind Command

You have two options:

  1. Type the command: Enter /rewind in the input area on your terminal
  2. Keyboard shortcut: Press Escape twice (Esc + Esc)

This command opens up a window where you can select a checkpoint in your current Claude conversation. The window shows the first line of your sent messages, and you can use your arrow keys to navigate up to read the messages and then select the checkpoint you want to rewind to.

The Four Options After Selecting a Checkpoint

Once you select a checkpoint, Claude gives you four options:

  1. Restore code and conversation: This forks the conversation, and if there were any code changes made after the point you chose to rewind to, those code changes will be reverted and lost permanently.

  2. Restore conversation: This forks the conversation but does not affect the code in any way.

  3. Restore code: The conversation history remains unchanged, but any code changes made after the point of rewind gets reverted.

  4. Never mind: Claude understands that you can change your mind, which is why you have this option.

Understanding "Forking" in This Context

Just a refresher for anyone who might be confused about my use of the term "fork."

In GitHub, forking means creating an independent copy of a repository that branches off from the original. After forking, your copy and the original can evolve separately, and changes to one don't affect the other.

In the context of Claude Code's rewind feature:

Checkpoint A → Checkpoint B → Checkpoint C → Checkpoint D (current)
                    ↓
              [You rewind here]
                    ↓
              New path forward (B')

When you rewind to Checkpoint B, it "forks" the conversation, meaning you create a new branch from that point. The original path (C → D) is abandoned/lost, and you start fresh from B going in a potentially different direction.

A good way to think of it is like running the git log command, which shows all changes you have committed. Then you can copy the hash for the point you either want to revert to or create a checkout/branch from, and use the appropriate git command to do so.

The key difference: Once you rewind to a checkpoint in Claude, everything after that point is permanently lost from the session. So this feature, while definitely beneficial, is only for quick session-level recovery and not a replacement for version control with Git.

Why This Command Is Useful

This tip provides a quick way of "managing disaster," so to say, when Claude makes changes to your code that end up making whatever issue you're trying to resolve worse.

It gives you peace of mind when letting Claude make big changes to your application since you know that you can always revert back.

What About Git Commits?

After learning about this command, I became curious about one thing: If I ask Claude to commit changes in a specific prompt, then I rewind to a checkpoint before that request was made, what happens? Do the commits also get undone?

Well, I tried it. The answer is no.

The rewind/checkpoint feature doesn't touch git operations. If you reverted to a point where a file was changed, the files revert to their previous state, but the commit still exists in your git history. So you essentially end up with uncommitted changes that are the reverse of your commit.

Important Limitations to Know

You should note that this feature has some limitations:

It will NOT revert:

  • Manual changes that you make to files yourself
  • Edits from other concurrent sessions (if you're crazy like me and sometimes have multiple sessions running in the same directory)
  • Changes made by bash commands, even when run by Claude itself

That last point is important: If Claude modifies files using bash commands (like rm, sed, echo >, mv, cp), those changes are not tracked by the checkpoint system and won't be reverted when you rewind.

Final Summary: Capabilities vs Limitations

The checkpoint/rewind feature DOES track:

  • File changes made through Claude Code's Edit tool
  • File changes made through Claude Code's Write tool

The checkpoint/rewind feature does NOT track:

  • Changes made via Bash commands
  • Git operations
  • External edits (changes made outside Claude Code)

The Takeaway

Think of /rewind as your "undo button" for Claude Code sessions. It's not a replacement for proper version control, but it's incredibly useful for those moments when Claude goes down a path you didn't want and you need to quickly get back to a known good state.

I hope you find this accidental tip I discovered to be useful.

As always, thanks for reading!

Share this article

Found this helpful? Share it with others who might benefit.