A wrapper around git
that lets you undo unfortunate git commands by making backups of your git repository. Currently, you can undo the 5 most recent git commands.
- Download wrapper.py into any directory of your choice.
cd
into that directory and typealias git="python $(pwd)/wrapper.py"
- Backups and configuration files are stored in
~/.git-undo/
- If you make a mistake with a
git
command, typegit undo
and things will return to the state they were in before that command was executed. - You can also redo an action with
git redo
. - If you want to turn off Git Undo, type
git undo off
; To turn it back on, typegit undo on
Since these commands only show information and don't affect the state of the repository, we don't save them to the undo history.
- git blame
- git config
- git describe
- git diff
- git log
- git shortlog
- git show
- git status
- Per-repository configuration
- More efficient backups