gitwtfhub

wtf is undo?

nvrmnd-png/undo — explained in plain English

Analysis updated 2026-05-18

51RustAudience · developerComplexity · 2/5LicenseSetup · easy

TL;DR

A Rust command line tool that lets you undo everyday shell commands like mv, cp, and rm by journaling every operation and reversing it on demand.

Mindmap

mindmap
  root((undo))
    What it does
      Reverses mv cp rm
      Journals to SQLite
      Sends deletions to trash
    Tech stack
      Rust
      SQLite
      BLAKE3
    Use cases
      Recover moved files
      Restore deleted folders
      Rewind renames
    Audience
      Developers
      CLI users
    Limitations
      Only wrapped commands
      No ACL preservation

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Recover a file after accidentally moving or overwriting it with mv or cp.

REASON 2

Restore a deleted directory from the trash after running rm -r.

REASON 3

Browse and undo past shell operations interactively with the built in TUI.

REASON 4

Roll back a batch rename made with the Perl style rename command.

What's in the stack?

RustSQLiteBLAKE3

How it stacks up

nvrmnd-png/undolucifer1004/veloqpsiini/israeli-alloc
Stars515151
LanguageRustRustRust
Setup difficultyeasymoderatehard
Complexity2/54/55/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

undo is a command line tool written in Rust that gives you a safety net for everyday shell commands like mv, cp, rm, mkdir, rmdir, chmod, chown, ln and rename. Instead of just watching what you type, it intercepts these commands through a small shell integration, performs the operation itself, and records exactly how to reverse it. That means when you accidentally move a file, delete a folder, or overwrite something important, you can type undo and get it back. Deletions do not disappear forever. Files removed with rm or rmdir go to the freedesktop.org trash instead of being erased, and any file that gets overwritten is backed up there first. Before any rollback happens, the tool checks the file's integrity using a BLAKE3 fingerprint, so it refuses to undo something that was changed after the fact unless you explicitly force it. To start using it, you install the binary, either built from source with cargo or downloaded as a prebuilt release, and add one line to your shell startup file for zsh, bash, or fish. After that, your normal mv, cp, and rm commands become undoable without changing how you type them. You can bypass the wrapper for a single command if needed. The tool includes several helper commands: undo lists recent actions, undo history shows the full journal, undo search finds entries by name, and undo tui opens an interactive text based browser for reviewing and undoing entries with the keyboard. Settings such as automatic cleanup, storage location, excluded paths, and custom command aliases live in a configuration file you can edit through a built in editor. There are limits. undo can only reverse operations that went through its own wrappers, so actions run through sudo, scripts, cron jobs, or graphical file managers are not tracked. File permissions like ACLs and extended attributes are not preserved during copies. The project is released under the MIT license, aside from an early version that remains under GPLv3.

Yoink these prompts

Prompt 1
Write a zsh function that summarizes undo's undo history --json output into a readable timeline.
Prompt 2
Explain how to configure undo's config.toml to exclude node_modules and .cache from journaling.
Prompt 3
Show me how to set up undo's shell integration for fish and verify it is intercepting rm.
Prompt 4
Help me understand why undo cannot track commands run through sudo or cron and what to do about it.

Frequently asked questions

wtf is undo?

A Rust command line tool that lets you undo everyday shell commands like mv, cp, and rm by journaling every operation and reversing it on demand.

What language is undo written in?

Mainly Rust. The stack also includes Rust, SQLite, BLAKE3.

What license does undo use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is undo to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is undo for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.