Domain Rating
by Ahrefs
Domain Rating by Ahrefs1
Description
undo reverts what your last shell command did to the filesystem. You install a small shell hook for zsh, bash or fish, and each command that changes files is recorded before its changes take effect, so after an accidental rm, mv or overwrite you can roll it back. It needs no daemon and takes no snapshots. The hook arms a small LD_PRELOAD library around each command. When the command calls libc to delete, rename, truncate or change something, the library saves the file first and then lets the call through. Saved files are kept as hardlinks, so no data is copied regardless of size, and the journal is a plain text file that undo replays from the bottom up. undo list shows the filesystem history of your session, newest first, with one entry per command that changed something, so you can pick the one to revert. Nothing runs between your commands. The site lists Ubuntu, Debian, Fedora, Arch, openSUSE and WSL2 on amd64 and arm64, and install options include Homebrew, the AUR, .deb and .rpm packages and building from source. The project is on GitHub.…
Highlights
- Reverts the filesystem changes of your last shell command
- Works with zsh, bash and fish
- No daemon and no snapshots
- Session history with undo list
- Covers rm, mv, truncating writes, mkdir and chmod
Ratings & Reviews
No ratings yet
Be the first to rate Undo.
People also visit
Undo FAQ
What is undo?
A command-line tool that reverts what your last shell command did to the filesystem.
Which shells does it work with?
zsh, bash and fish, through a shell hook.
Which commands can it undo?
The page lists rm, mv over a file, writes that truncate a file, mkdir and chmod, among others.
Does it keep background copies?
No. It runs no daemon and takes no snapshots. It saves the files a command is about to change, using hardlinks, and nothing runs between commands.
How do I install it?
Use the install script on the site, Homebrew, the AUR, a .deb or .rpm package, or build from source.
What are the best Undo alternatives?
Popular alternatives to Undo include Backintime, Rovr and Zshistory. See all Undo alternatives




