DEV Community

Discussion on: Git - How to fix a bad commit

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

Wrote this script to undo your last git f**k up (still in WIP for a stable release)
Might help someone :)

GitHub logo Bhupesh-V / ugit

🚨️ ugit helps you undo your last git command with grace. Your damage control git buddy

ugit

ugit logo

Undo your last oopsie 🙈️ in git without much effort

License: MIT Issues Twitter: bhupeshimself ugit demo gid

Why ugit

  • You did an accidental git command you didn't want to.
  • You don't want to waste your time searching on how to undo ...

What's in the box

ugit supports undoing following operations, some are a WIP. If you know of any operation that can be undone and is not in the list, make sure to send a quick PR 💛️

  • Undo git commit
  • Undo git add
  • Undo git push
  • Undo git branch -D (branch delete)
  • Undo git pull
  • Undo git reset
  • Undo git tag -d (tag delete)
  • Undo git stash apply
  • Undo git stash pop/drop/clear
  • Undo accidental file delete (Restore a deleted file after a commit)
  • Undo (Restore) a file to a previous version
  • Undo git merge
  • Undo git tag (rename a tag)
  • Undo git rebase
  • Undo git cherry-pick
  • Undo git worktree remove (recover deleted work-tree)

Installation




Collapse
 
guivern profile image
Guillermo Verón

Wow! Great job! 🤯️