# dsh-rollback · TRAE-style rollback plugin

[中文](./README.md) · English
[](https://awesome-dsh-plugin.com) [](https://awesome-dsh-plugin.com) [](https://www.npmjs.com/package/@domitor-syh/dsh-rollback) [](https://www.npmjs.com/package/@domitor-syh/dsh-rollback) [](./LICENSE) [](https://github.com/domitor-syh/dsh-rollback/actions/workflows/test.yml)
Turn-based rollback for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) Web client: restore tracked file changes and withdraw the corresponding model-visible conversation while keeping the same session.
## Features
- **Turn-based rollback**: choose from the latest 10 retained checkpoints using a button or `/rollback`.
- **Files and conversation together**: restore previous content, recover deleted files and undo file creation; files with equal initial and final states are left untouched.
- **Confirm before execution**: review affected files and external-change warnings in the dialog.
- **Draft restoration**: the confirmation flow attempts to put the original message and recoverable attachments back into the composer.
- **Recovery progress retained**: retry after failure or attempt compensation of file operations.
## Install
**Web** (`dsh web`):
```sh
dsh plugin --profile web add @domitor-syh/dsh-rollback
```
**Desktop** (the official channel) — enter the package name **`@domitor-syh/dsh-rollback`** where plugins are installed, or use the equivalent command:
```sh
dsh plugin --profile desktop add @domitor-syh/dsh-rollback
```
After installing: restart `dsh web` and refresh the page on the web side, restart the desktop app on the desktop side. When running DSH from source, prefix the commands with `pnpm`.
The current target is **DSH 0.2.1-rc.2**. The declared compatibility range remains `>=0.1.5-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.3.0-0`; older versions have not been revalidated for this adaptation.
0.5.1 fixes relative file paths capturing a same-named file in the original directory after the session working directory changes. Rollback continues to use the target path recorded when the file was changed.
## Usage
There are three ways to use the plugin:
1. **Rollback button**: click **Rollback** on an ended turn → review affected files → confirm rollback.
2. **`/rollback`**: enter `/rollback` without arguments → open the turn picker → choose a target turn → review affected files and confirm rollback.
3. **`/rollback` + Space**: type `/rollback` and press Space → open the subcommand menu → select a command or arguments → press Enter to execute. Selecting a menu item only completes arguments; it does not execute immediately. `preview` opens a turn submenu; press Esc to return.
| Command | Purpose |
| --- | --- |
| `/rollback` | Choose a turn and open the confirmation dialog |
| `/rollback latest` | Directly roll back the latest checkpoint |
| `/rollback