undo_edit
Revert only the file changes from the last write, preserving all other uncommitted edits. Refuses to run if the file changed externally, preventing silent data loss.
Instructions
Revert plumb's most recent write to a file — the safe alternative to git checkout <file>, which discards EVERY uncommitted change in the file. undo_edit restores only what plumb's last edit_file/write_file changed, and refuses by default if the file was modified since (an external or peer edit), so it never silently clobbers someone else's work (pass force:true to override). If the last write created the file, undo removes it. Single-level per file: it undoes the last write; a fresh write re-arms it. Undo history is per session and cleared on a workspace switch. Very large files (pre-write content over 1 MiB) are not snapshotted, so undo is unavailable for them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Revert even if the file changed since plumb's last write to it (an external or peer edit). Default false — the undo is refused in that case so it cannot silently discard someone else's change. | |
| file_path | No | Absolute path, file:// URI, or workspace-relative path of the file to revert. |