DEV Community

Cover image for DeepSeek Harness rewind plugin: recover a deleted file and undo the rewind
Borui Cai
Borui Cai

Posted on Originally published at extracurricular.ai AI-assisted

DeepSeek Harness rewind plugin: recover a deleted file and undo the rewind

A coding agent deletes a file you still need. You want to restore the file and return the conversation to the point before that mistake. Then you realize you chose a restore point that was too early.

DSH Rewind & Redo — by FileSnap (dsh-filesnap) is a DeepSeek Harness rewind plugin for this workflow: restore a conversation and its tracked files together, preserve the original conversation, and use /redo to reverse the rewind.

I maintain this unofficial community plugin. This article is adapted from our installation and usage guide, which documents FileSnap 0.2.2, reviewed on September 9, 2026. The screenshots show an existing Web UI session on a DSH 0.1.2-rc.1 local build; they do not establish compatibility with every later release.

Watch the complete workflow

The walkthrough is about 2 minutes 29 seconds. Video and original narration are already accelerated to 1.5×, so leave the player at normal speed. It shows file deletion, rewind, the preserved conversation, and redo.

Updated: UI integration and file deduplication

dsh-filesnap provides rewind controls directly in the DSH chat interface. Restore the conversation and tracked files together, then use /redo to reverse a mistaken rewind.

We also published seven versioned storage tests comparing FileSnap 0.4.0 with dsh-rewind-plugin 0.9.1. FileSnap stored fewer file-content copies in four cases involving repeated content across versions, paths,sessions or shared-store workspaces; three cases tied. These results measure stored file contents, not total disk usage or execution speed.
Read the comparison and reproducible evidence.

The article also documents our integration experience across Codex, DSH and Pi, with versions and source links.

Install the plugin

Use a built or npm-installed DSH CLI. Install into the Web UI profile:

dsh plugin --profile web add dsh-filesnap
Enter fullscreen mode Exit fullscreen mode

Restart that profile. Version 0.2.2 declares its bundle, so it does not need a manual loader entry. The command installs the available version; use dsh-filesnap@0.2.2 to reproduce the documented plugin version.

If upgrading from a manually configured older installation, remove its old id: filesnap loader entry from cordis.patch.yml before starting 0.2.2, to avoid loading it twice. See the full guide for platform requirements and troubleshooting.

Capture a file before trying recovery

Start in a disposable workspace. Ask the agent to create a small file, edit it in another turn, and then delete it. Wait for each turn to finish.

FileSnap needs an earlier capture to recover that version. Installing it after a deletion cannot recover a historical state it never captured.

Enter:

/rewind
Enter fullscreen mode Exit fullscreen mode

Choose a captured point before the deletion. You can also use the Web UI rewind control; read its tooltip to confirm the target and coverage.

The rewind control identifies its target turn and snapshot coverage

For example, only if turn 2 is the target listed in your session, enter:

/rewind 2
Enter fullscreen mode Exit fullscreen mode

This restores the state before turn 2. It does not mean “go back two turns.” The restore writes into your actual workspace, so wait for the agent to stop before using it.

Check that the file exists again and contains the expected text.

Know which conversation you are in

Rewind creates a child conversation and preserves the original. The Web UI rewind button opens the child; the typed command returns its session ID. Open that child yourself if the UI stays in the original conversation.

Both conversations share the same physical workspace directory. The fork preserves conversation history; it does not create a second directory or an isolated Git worktree. Switching conversations does not automatically swap independent copies of the files.

Reverse a mistaken rewind

Before making more edits, enter this in the child conversation:

/redo
Enter fullscreen mode Exit fullscreen mode

Redo reverses the rewind using the rescue state recorded before restoration. It returns the original conversation as the continuation target; follow the returned session when using the command path.

The redo result identifies the original continuation session

In this deletion exercise, redo deletes the recovered file again. That is the expected result: you are returning to the state immediately before the rewind. This is why checking both the file and the active conversation matters.

What is covered—and what is not

No Git repository is required. Capture combines known paths, paths observed through DSH's ctx.fs writes or edits, and a bounded scan for recent workspace changes. It is not an unlimited backup of every path a shell command can touch.

.filesnapignore applies to capture and restore. Inspect /rewind status and the chosen point's coverage; current status does not prove an old snapshot contains a particular file.

Two limitations of the documented setup are worth checking before adoption:

  • Sessions captured by the plugin require it to remain installed to open through DSH. Uninstalling leaves the data on disk, but reading those sessions requires reinstalling the plugin.
  • A source launch with pnpm dsh can encounter an event-registration error caused by separate module instances. Use the built or npm-installed CLI for the documented workflow.

The useful first test is a complete loop: capture → delete → rewind → redo, checking the file contents and conversation at every step.

Source code and issue tracker · Full English guide · 中文教程

If you try it, which step worked or failed? Include your DSH version, plugin version, operating system, and whether you used the Web UI button or a typed command.

Top comments (0)