---
title: "@henryqw/pi-undo"
seo:
  description: "Rewind Pi conversation context to the latest user prompt."
---

<div class="not-prose my-6 flex flex-wrap items-center gap-3"><a href="https://www.npmjs.com/package/@henryqw/pi-undo" aria-label="View @henryqw/pi-undo version v3.2.1 on npm"><img alt="Version v3.2.1" height="20" src="https://img.shields.io/static/v1?cacheSeconds=7200&amp;color=1d4ed8&amp;label=version&amp;labelColor=6a7282&amp;style=flat-square&amp;message=v3.2.1" width="96"></a><div class="ml-auto flex flex-wrap items-center justify-end gap-3"><a href="https://www.npmjs.com/package/@henryqw/pi-undo" aria-label="View @henryqw/pi-undo on npm"><img alt="Monthly npm downloads" height="20" src="https://img.shields.io/npm/dm/%40henryqw%2Fpi-undo?cacheSeconds=7200&amp;color=1d4ed8&amp;label=downloads&amp;labelColor=6a7282&amp;style=flat-square" width="144"></a><a href="https://github.com/HenryQW/pi-harness/blob/main/extensions/pi-undo/LICENSE" aria-label="View the MIT license for @henryqw/pi-undo"><img alt="MIT license" height="20" src="https://img.shields.io/npm/l/%40henryqw%2Fpi-undo?cacheSeconds=7200&amp;color=1d4ed8&amp;label=license&amp;labelColor=6a7282&amp;style=flat-square" width="78"></a></div></div>

Return to the latest user prompt on the current branch, without later conversation context. Edit and resend the prompt in place instead of copying it into a new turn.

## Install

```bash
pi install npm:@henryqw/pi-undo
```

## Use

Run `/undo` with no arguments. It cancels active work, waits for it to stop, then returns to the undo target.

The command does not select prompts on other branches. If the current branch has no user message, Pi displays `Nothing to undo.`

## Limits and recovery

Conversation rewind does not revert filesystem changes. Review or restore files separately before you resend the prompt.
