dsh-rollback
用于 DeepSeek Harness 的文件修改回滚插件,通过 git 或快照备份并在需要时恢复文件。
AI 分析
核心用途是防止 AI 智能体在执行写文件或编辑文件工具时误抹除重要代码。适合进行代码生成或文件操作任务的用户,支持通过 `/rollback` 命令或让模型自动调用工具回滚。
安装
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.