Unlike existing command-level solutions like aliasing
rmto trash-cli, Unco is designed to be capable of undoing changes made by any program; it hooks the library calls that affect the file system and records the changes for later undoing.
The following scenario illustrates how it can be used, in case of
- instruct the shell to record all
% alias git="unco record -- git"
- edit file under the git repository
% vi program.c
- Oops! I have accidentally reset the changes
% git reset --hard HEAD
- don't worry, just undo the last action
% undo history index command (*=undone) 1 git reset --hard HEAD % unco undo 1
make installor whatever command.
The development is still in early stages, and I would not advise anybody not capable of debugging the code by oneself to use it. But for those interested, the repo is at github.com/kazuho/unco.
For the time being, the program runs on OS X and linux (edited Apr. 3 2014)