Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
fboers46yHave you tried git reflog? If you've committed or staged your changes you should be able to recover them.
-
thumbcore546yThis is also why we can make branches on the local repo. Keep all this history you want. Commit often. When ready to push, branch a second time, squash your changes, then merge into the desired branch. This way you have history, have a backup branch in case you screw up the squash, and ideally don't lose your work.
-
Luckily my IDE has its own vcs which allows me to undo changes on disk, saved my ass multiple times 😅
-
fleka286y@thumbcore I appreciate your advice, this is how I work in the past several years. This happened when I started with git. Just wanted to share with the others.
So I had two days of commits without any push, wanted to soft reset in order to remove and change something before I push and instead I hit hard reset. It was me not being careful enough, and they have but a better distinction between the two options. Was using SmartGit at that time. -
mksana2466yGit is fantastic for what it is, but most dev teams actually only need this
http://ifuelsys.com/wp-content/...
and with git, they instead get this
https://upload.wikimedia.org/wikipe... -
JetBrains' IDEs supports a local history. So I can even restore all the hard resetted code outside of git.
Related Rants
Hitting hard reset on git instead of soft. Lost two days of work.
rant
wk149