Kelly Stannard
Posted on May 3, 2022
So, everyone's git right of passage is to nervously try to run a git command and then realize with horror that you just lost your work on your local repo. Then you run to google and try to find out how to reverse what you just did and run some archaic commands to find the lost commits.
With a small amount of foresight, you can just create a new branch called "backup" pointing to your work and reset back to it if necessary.
$ git branch -C backup
# mess up your git branch
$ git reset backup --hard
# good to go
💖 💪 🙅 🚩
Kelly Stannard
Posted on May 3, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
github Github’ımız Nasıl Daha İyi Hale Getirilir? Profil Nasıl Hazırlanır? README Nasıl Yazılır?
November 29, 2024
tutorial Configure Git with Multi-Account SSH and Verified Commits Using GPG in Github
November 28, 2024