Skip to main content
Managing Sessions & Changes

Revert Changes and Restore Session

Overview

When collaborating with Qoder, you may want to return to a previous state—undoing a recent batch of changes or resuming the conversation from an earlier point to start over. Qoder CLI provides this capability through Rewind: it uses user messages in the conversation as checkpoints, allowing you to restore the conversation, file changes, or both to an earlier state.

Rewind (/rewind)

Use /rewind to open the Rewind interface:
/rewind
The Rewind interface lists the checkpoints in the conversation (marked by the user messages you sent). After selecting a checkpoint, Qoder will display the impact of rewinding from that point and ask for your confirmation.

What Can Be Restored

When confirming a rewind, you can choose the scope of the restoration:
  • Restore conversations and files (default): Restores the conversation to the checkpoint and reverts all file changes made by Qoder after that point.
  • Restore conversation only: Restores the conversation history to the checkpoint while leaving files in their current state.
  • Restore files only: Reverts file changes made by Qoder after the checkpoint while leaving the conversation in its current state.
The Rewind interface displays the number of files affected and the lines added and deleted if files are restored (e.g., "Rewinding now will revert 3 files (+42 -17)"), helping you understand the scope of impact before confirming.
File changes made through manual editing or Shell commands may not be reverted by Rewind. Rewind primarily targets changes made by Qoder through its file editing tools.

How It Works

Qoder CLI records the file editing history during a session. Each checkpoint corresponds to a user message in the conversation, and Qoder tracks the file changes that occur afterward. When you choose to rewind to a specific checkpoint:
  • If you choose to restore the conversation, the conversation history is truncated back to that checkpoint.
  • If you choose to restore files, Qoder uses the recorded editing history to revert the relevant files to their state at the checkpoint.
If there are no file changes to revert for a particular checkpoint, the Rewind interface will clearly indicate "Will restore conversation, no file changes involved."

When to Use

Rewind is suitable for the following scenarios:
  • Qoder has gone in the wrong direction, and you want to return to the fork in the road to restate your requirements.
  • The recent batch of changes is unsatisfactory, and you want to quickly revert them and try a different approach.
  • You want to branch out from an earlier point in the conversation to explore a different solution.
If you want to explore a new direction from a certain point while keeping the original session, you can also consider using Session Branches; see Session Management. Rewind is "going back in time in place," whereas branching is "forking a new path from the past."

Tips

  • Pay attention to the file impact scope displayed in the interface before rewinding to ensure the content to be reverted meets your expectations.
  • When dealing with important changes, it is safer to use it in conjunction with Git: committing at key points allows you to recover even if you go beyond the scope that Rewind can cover.
  • Rewind only applies to the editing history recorded within the current session; cross-session changes or those made manually/via Shell are outside its scope.