dsh-rollback
File-mutation rollback plugin for DeepSeek Harness — checkpoints write/edit pre-images via git blobs or snapshots and restores them on demand through a model-facing rollback_files tool and a /rollback command. Opt-in bundle: capture rides the tools/result observation event, restore writes files directly (no loop change).
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Taler97/dsh-rollback说明文档
阅读完整 README ↗Usage
30-second quickstart
- Open a session whose working directory is a git repository.
writea filenotes.mdwith the contenthello.writeit again withgoodbye— the first content is silently checkpointed.- Tell the model "restore the file you just overwrote" (it calls
rollback_files), or type/rollbackyourself. - Read
notes.md: it sayshelloagain.
For humans — /rollback [count]
Type it in the chat input (base web and headless profiles mount the command registry the command needs):
/rollback— undo the single most recent captured mutation in this session's working directory,/rollback 3— undo the three most recent ones.
The output lists every restored file and its action:
rollback: restored 2 file mutation(s):
restored /ws/src/lib/parse.ts
deleted /ws/src/lib/generated.ts
For models — rollback_files
One model-facing tool, rollback_files {count} (no prompt section). It is meant for the model to undo its own write/edit mistakes instead of asking the user. Restores are scoped to the calling session's working directory and reported as a per-file summary — restored file contents are not echoed.
What is captured
Only successful write/edit tool results that carry a before pre-image. Mutations through bash, str_replace_editor, or raw subprocesses carry no pre-image and are not captured (see Known Limitations). A session can only restore records at or under its own working directory.