Git undo is an extension for git that adds convenient,and easy to remember, commands to undo commits, applied stashes and pushed merges.
Currently there are three commands you can run to undo things. git undo commit, git undo stash-apply and git undo pushed-merge <merge-commit-hash>
.
Installation
The installations is quite simple right now, download the project and copy git-undo to /usr/local/bin/ if you are running Linux or mac.
On Windows you put the file into C:\Program Files\Git\mingw64\libexec\git-core or C:\Program Files (x86)\Git\mingw64\libexec\git-core depending on where git is installed.
Commands
the undo commit command undos the latest commit made and stages the changes from that commit, so you will not lose the changes, but can for example add files you forgot before committing. You can also do changes before committing again. To read more about how this command works you can read this post.
the undo stash-apply, does what it says, if you have applied a stash on for example the wrong branch you can use this command to undo that, this command comes from this blog post where you can read more.
the undo pushed-merge helps you undo a git merge that is already pushed to the origin. run a git log to get the merge commit hash. Read more about how this works.
Contribute
This is an open source project, if you would like to add some undo method you can fork the project and send a pull request!