Back to plugins
dsh-turn-rewind Cover

dsh-turn-rewind

Message-anchored project-file recovery — restore points plus a change ledger for safe rewind

github.com/Anionex/dsh-turn-rewind
99 BSD-3-Clause Author Anionex Updated

Install

dsh plugin --profile web add @anionex/dsh-turn-rewind

Screenshots 1

dsh-turn-rewind

Agent broke your working tree? Skip the blunt git rollback — anchor every change to a message, review the drift, restore selectively, and jump back to “before you sent that message”.

What problem it solves

When an agent rewrites a lot of code and you want to undo it, the usual move is git reset or stash — but a hard rollback can clobber good uncommitted work, and you often can’t say exactly what changed. A diff button only shows the current changes; it doesn’t own a durable restore lifecycle and can’t answer “what did the files look like before this message?”

This plugin solves that by anchoring recovery to messages: in the Web UI, each user message gains an icon-only Rewind action. Opening it previews path-level file drift and offers “restore files and restart” (back to before that message, with its text put back in the composer) or “restore files only” (leaving the current session untouched). Underneath, the durable Change Ledger engine (the ctx.changeLedger service) owns the full lifecycle: restore points, rescue points, hash verification, rollback, and startup reconciliation.

Key features

  • Message-anchored restore points: a Rewind action on every user message returns files to “before sending this message”
  • Two restore modes: restore files and restart (default) / restore files only (current session stays open)
  • Path-level drift preview: review a full or selective restore plan; previewing changes no files
  • Strict safety contract: never commits, stashes, resets, switches branches, or edits the Git index — every restore starts from your final button plus DSH human approval
  • Rescue points and verification: automatic pre-restore rescue points, post-restore hash verification, rollback on failure
  • Stale-plan detection: any relevant workspace or branch/operation change between review and apply invalidates the plan
  • Crash reconciliation: startup reconciles interrupted restore journals, marking non-terminal ones interrupted
  • Reusable public service: other plugins can inject ctx.changeLedger and call the same restore lifecycle

Quick start

Install and restart the DSH profile; a Rewind action then appears under each user message in the Web UI. Click it to preview affected files, choose “restore files and restart” or “restore files only”, and confirm in the dialog. Retention, file-size, and plan-TTL limits can be overridden in config (e.g. maxRestorePoints, maxFileBytes, planTtlMs). Plugin authors can also inject: ['changeLedger'] and call ctx.changeLedger.create(...) to reuse the same capabilities.

Who it is for

  • Developers who let agents change lots of code and want a safe “undo”
  • Teams that need traceable, selectively recoverable workspace changes
  • Plugin authors who want to reuse restore capabilities in their own plugins
Tags DevTools

Compiled from the project README · All rights belong to the original author

Report issue / Request removal

Related plugins