undo.sh
A shell script for reversing mistakes
git reset --soft
The gentlest undo. Your changes remain staged, your work is preserved. Only the commit pointer moves back. It is the undo that says: the work was correct, only the packaging was wrong.
rm -rf mistakes/
The nuclear option. No recovery, no mercy. But sometimes, the cleanest undo is the most complete one. The directory is gone. The disk space is free. The mistake is a memory, not a file.
ctrl+z && ctrl+z
Sometimes one undo is not enough. The repeated undo -- stepping back through history, state by state -- is the meditative practice of the terminal. Each step reveals what was, and in the revelation, teaches what should be.
exit 0
Every script ends. undo.sh terminates with exit code 0: success. The undo was performed. The system is clean. The terminal waits, cursor blinking, for the next command.