brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: /rewind undoes Claude's edits without touching git

Claude
~/tips/tip-claude-rewind-undo-edits

/rewind

Rolls the code and the conversation back to an earlier prompt in your Claude Code session.

Claude just rewrote a file in a way I would not have asked for. Before I reach for git checkout, there is a quicker way out.

Claude Code snapshots your files before every prompt that starts a turn. Type /rewind (the alias is /undo) or press Esc twice on an empty prompt, and a menu lists your earlier prompts.

/rewind

Pick a prompt and choose what to roll back: code and conversation, only the conversation, or only the code. There is also Summarize from here, which squeezes a long debugging stretch into a short summary and frees context. After a restore, your original prompt lands back in the input box, so you can edit it and send it again.

Example: you asked for a small refactor and Claude touched six files. Rewind to that prompt, restore the code, rephrase the request more tightly, and go again.

The caveat matters. Rewind only tracks edits made with Claude’s own file tools. If a file was changed only by a shell command, or by a subagent, it stays as it is. The docs say it plainly: this is session-level recovery and does not replace git. I would still commit before a big task.

Further reading: Checkpointing – Claude Code docs, Commands – Claude Code docs, On this site: ask Claude Code a /btw question and keep your context clean, On this site: let a PostToolUse hook run Prettier after every Claude edit

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link