Undo your last git mistake with ugit

So I have been working on this little tool called ugit (and was finally able to release a stable version), the goal is to make it easier for beginner to intermediate git users to undo their last (accidental) git command. Because we are not perfect and …


This content originally appeared on DEV Community and was authored by Bhupesh Varshney ?

So I have been working on this little tool called ugit (and was finally able to release a stable version), the goal is to make it easier for beginner to intermediate git users to undo their last (accidental) git command. Because we are not perfect and commit mistakes.

“Oh wait I deleted the auth-jwt branch without merging!! fuck”

Opens browser

“How to restore deleted branch”

Wastes 5 minutes reading the thread,

Brain context switch, losses focus

“Aarrgh, Git sucks”

Failure is a good way to learn something new but how many times are you going to mess up with git, if your ultimate goal is to deliver the new feature in your startup as fast as possible, huh? Git is great but it’s not really good with developer experience (DX).

Yo bhupesh, I can just you know alias this command. Oh cool, good luck remembering that alias after 1 month when you fuck-up again.

If you are in the gang of getting things done, adding ugit might be a good choice for you.

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 with ease

License: MIT platform support linux and macos bash love Twitter: bhupeshimself ugit demo gif

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 ...
  • Because ugit is cool

What's in the box

ugit supports undoing following operations, some are a WIP. If you know of any other operations 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

Ok enough talking.

What is ugit?

It’s just a simple shell script with guided programmatic steps to undo your last git command, powered by FZF built for people who live and work with terminals every day.

Guided Tutorials

Below are some GIF demos of undoing some git operations, the list is long (around 17 scenarios) but I am only demonstrating some common ones.

Undoing git add

Undoing git branch -D (Restore deleted branch)

Undoing/Restoring file to previous version

Undoing git merge

I don’t like your stupid script

sad dogo crying

Cool, I mean we are still friends right?? Friends help friends avoid git mistakes, that’s why I wrote an accompanying text guide on How to undo anything in Git.

Share it with your friends, co-workers. No hard feelings

Peace ✌️


This content originally appeared on DEV Community and was authored by Bhupesh Varshney ?


Print Share Comment Cite Upload Translate
APA
Bhupesh Varshney ? | Sciencx (2022-10-02T14:24:07+00:00) » Undo your last git mistake with ugit. Retrieved from https://www.scien.cx/2021/05/02/undo-your-last-git-mistake-with-ugit/.
MLA
" » Undo your last git mistake with ugit." Bhupesh Varshney ? | Sciencx - Sunday May 2, 2021, https://www.scien.cx/2021/05/02/undo-your-last-git-mistake-with-ugit/
HARVARD
Bhupesh Varshney ? | Sciencx Sunday May 2, 2021 » Undo your last git mistake with ugit., viewed 2022-10-02T14:24:07+00:00,<https://www.scien.cx/2021/05/02/undo-your-last-git-mistake-with-ugit/>
VANCOUVER
Bhupesh Varshney ? | Sciencx - » Undo your last git mistake with ugit. [Internet]. [Accessed 2022-10-02T14:24:07+00:00]. Available from: https://www.scien.cx/2021/05/02/undo-your-last-git-mistake-with-ugit/
CHICAGO
" » Undo your last git mistake with ugit." Bhupesh Varshney ? | Sciencx - Accessed 2022-10-02T14:24:07+00:00. https://www.scien.cx/2021/05/02/undo-your-last-git-mistake-with-ugit/
IEEE
" » Undo your last git mistake with ugit." Bhupesh Varshney ? | Sciencx [Online]. Available: https://www.scien.cx/2021/05/02/undo-your-last-git-mistake-with-ugit/. [Accessed: 2022-10-02T14:24:07+00:00]
rf:citation
» Undo your last git mistake with ugit | Bhupesh Varshney ? | Sciencx | https://www.scien.cx/2021/05/02/undo-your-last-git-mistake-with-ugit/ | 2022-10-02T14:24:07+00:00
https://github.com/addpipe/simple-recorderjs-demo