<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Boris Stojanov</title>
    <description>The latest articles on DEV Community by Boris Stojanov (@boris_stojanov_7fda5f6d91).</description>
    <link>https://dev.to/boris_stojanov_7fda5f6d91</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4255300%2F835e222c-aad6-456c-b1ee-93d5d8ec8b2f.png</url>
      <title>DEV Community: Boris Stojanov</title>
      <link>https://dev.to/boris_stojanov_7fda5f6d91</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/boris_stojanov_7fda5f6d91"/>
    <language>en</language>
    <item>
      <title>How to undo a change in Claude Code: /rewind, checkpoints and Git</title>
      <dc:creator>Boris Stojanov</dc:creator>
      <pubDate>Fri, 20 Nov 2026 08:50:45 +0000</pubDate>
      <link>https://dev.to/boris_stojanov_7fda5f6d91/how-to-undo-a-change-in-claude-code-rewind-checkpoints-and-git-5gom</link>
      <guid>https://dev.to/boris_stojanov_7fda5f6d91/how-to-undo-a-change-in-claude-code-rewind-checkpoints-and-git-5gom</guid>
      <description>&lt;p&gt;&lt;em&gt;I build with Claude Code every day and wrote this for people who don't code. First posted on &lt;a href="https://solidvibes.dev/blog/undo-changes-in-claude-code/" rel="noopener noreferrer"&gt;solidvibes.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You asked Claude Code for one change. It made three, and now the page looks wrong. Good news: you can go back. This post shows how, what the undo can and can't reach, and the one habit that makes every mistake easy to fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  First: stop it
&lt;/h2&gt;

&lt;p&gt;If Claude is still working and heading the wrong way, press &lt;code&gt;Esc&lt;/code&gt;. It stops at once, and nothing it already did is lost or broken. Then you can undo calmly.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quick undo: /rewind
&lt;/h2&gt;

&lt;p&gt;Claude Code saves a checkpoint of your files before each message you send (&lt;a href="https://code.claude.com/docs/en/checkpointing" rel="noopener noreferrer"&gt;checkpointing docs&lt;/a&gt;). Going back to one takes three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Type &lt;code&gt;/rewind&lt;/code&gt; and press Enter. Or press &lt;code&gt;Esc&lt;/code&gt; twice when the prompt is empty. &lt;code&gt;/undo&lt;/code&gt; does the same.&lt;/li&gt;
&lt;li&gt;A list of your earlier messages appears. Pick the one sent just before things went wrong.&lt;/li&gt;
&lt;li&gt;Choose what to restore.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; If text is in the prompt, the first double &lt;code&gt;Esc&lt;/code&gt; only clears it. Press &lt;code&gt;Up&lt;/code&gt; later to get your text back.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Which restore do I pick?
&lt;/h2&gt;

&lt;p&gt;The menu gives you a few choices (&lt;a href="https://code.claude.com/docs/en/checkpointing" rel="noopener noreferrer"&gt;checkpointing docs&lt;/a&gt;):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Choice&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;th&gt;Use it when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Restore code and conversation&lt;/td&gt;
&lt;td&gt;Files and chat both go back&lt;/td&gt;
&lt;td&gt;You want a clean second try&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restore code&lt;/td&gt;
&lt;td&gt;Files go back, the chat stays&lt;/td&gt;
&lt;td&gt;Claude should remember what went wrong&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restore conversation&lt;/td&gt;
&lt;td&gt;Only the chat goes back&lt;/td&gt;
&lt;td&gt;The files are fine, the talk went off track&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Never mind&lt;/td&gt;
&lt;td&gt;Nothing changes&lt;/td&gt;
&lt;td&gt;You picked the wrong line&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Most of the time, &lt;strong&gt;Restore code and conversation&lt;/strong&gt; is the one you want. Your old message comes back into the prompt, so you can reword it and send it again.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt; Go back to how it was. Only change the button colour on the home page, nothing else.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you see no code choices at all, Claude changed no files after that point. Only the chat can go back.&lt;/p&gt;

&lt;h2&gt;
  
  
  What /rewind can't undo
&lt;/h2&gt;

&lt;p&gt;Checkpoints are a quick safety net, not a full history. The docs name what they miss (&lt;a href="https://code.claude.com/docs/en/checkpointing#limitations" rel="noopener noreferrer"&gt;limitations&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Files changed only by a command.&lt;/strong&gt; Claude sometimes runs commands instead of editing files directly, for example to install something or move files. If a command was the only thing that touched a file, &lt;code&gt;/rewind&lt;/code&gt; leaves it as it is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your own changes.&lt;/strong&gt; Edits you made yourself, outside Claude Code, are not tracked. Nor are edits from another Claude Code window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Some helper work.&lt;/strong&gt; Claude can hand parts of a job to helpers (subagents). Their edits to new files are usually not restored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Old sessions.&lt;/strong&gt; Checkpoints are deleted about 30 days after a session last saved one.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Checkpoints never undo things that happened outside your folder: a deployed website, a sent email, a changed database. Undo those where they happened.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The safer undo: Git
&lt;/h2&gt;

&lt;p&gt;Git is a tool that saves named snapshots of your whole project. Each snapshot is called a commit. The checkpointing docs say it plainly: checkpoints are for quick recovery inside one session, and for lasting history you keep using version control, such as Git (&lt;a href="https://code.claude.com/docs/en/checkpointing#not-a-replacement-for-version-control" rel="noopener noreferrer"&gt;checkpointing docs&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;You don't need to learn Git commands. Ask Claude:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt; Set up Git for this project if it isn't already, and save my work now with a short message.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then, each time something works, ask it to save again. The quickstart shows the same kind of request: "commit my changes with a descriptive message" (&lt;a href="https://code.claude.com/docs/en/quickstart" rel="noopener noreferrer"&gt;quickstart&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;If something breaks later, even days later, in a new session, or through a command &lt;code&gt;/rewind&lt;/code&gt; couldn't see, ask Claude to go back to the last snapshot that worked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt; The site was working at my last save. Show me what changed since then, and undo it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Git can also undo one saved change and keep everything after it (&lt;a href="https://git-scm.com/docs/git-revert" rel="noopener noreferrer"&gt;git revert&lt;/a&gt;). Claude knows how; you just say which change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one should I use?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude just did something wrong, a few messages ago&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/rewind&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You want to try the same request worded differently&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/rewind&lt;/code&gt;, Restore code and conversation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The problem is from yesterday or an older session&lt;/td&gt;
&lt;td&gt;Git&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A command Claude ran broke things&lt;/td&gt;
&lt;td&gt;Git&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You want to keep the new work but drop one old change&lt;/td&gt;
&lt;td&gt;Git&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  A simple habit
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Before a big request, ask Claude to save your work with Git.&lt;/li&gt;
&lt;li&gt;After each step that works, save again.&lt;/li&gt;
&lt;li&gt;When something goes wrong right away, use &lt;code&gt;/rewind&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When &lt;code&gt;/rewind&lt;/code&gt; can't reach it, go back to your last save.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this habit, a bad change costs you a minute, not an afternoon. New to Claude Code? Start with &lt;a href="https://solidvibes.dev/guides/claude-code-for-non-developers/" rel="noopener noreferrer"&gt;Claude Code for non-developers&lt;/a&gt;. It covers installing, your first session and the basics of stopping and undoing.&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>beginners</category>
      <category>git</category>
    </item>
  </channel>
</rss>
