docs/cli/tutorials/session-management.md
Resume, browse, and rewind your conversations with Gemini CLI. In this guide, you'll learn how to switch between tasks, manage your session history, and undo mistakes using the rewind feature.
It's common to switch context—maybe you're waiting for a build and want to work on a different feature. Gemini makes it easy to jump back in.
The fastest way to pick up your most recent work is with the --resume flag (or
-r).
gemini -r
This restores your chat history and memory, so you can say "Continue with the next step" immediately.
If you want to find a specific conversation from yesterday, use the interactive browser.
Command: /resume
This opens a searchable list of all your past sessions. You'll see:
Select a session and press Enter to load it.
Over time, you'll accumulate a lot of history. Keeping your session list clean helps you find what you need.
In the /resume browser, navigate to a session you no longer need and press
x. This permanently deletes the history for that specific conversation.
You can also manage sessions from the command line:
# List all sessions with their IDs
gemini --list-sessions
# Delete a specific session by ID or index
gemini --delete-session 1
Gemini CLI's Rewind feature is like Ctrl+Z for your workflow.
At any point in a chat, type /rewind or press Esc twice.
You'll see a list of your recent interactions. Select the point before the undesired changes occurred.
Gemini gives you granular control over the undo process. You can choose to:
Sometimes you want to try two different approaches to the same problem.
/resume save decision-point./resume resume decision-point to fork the conversation back to
that moment and try a different approach.This creates a new branch of history without losing your original work.
/resume
options, grouped checkpoint menus, and /chat compatibility aliases.