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
-
You can just checkout old commit, if you have it's sha
You can het it via some kind of history command -
asgs115636y@TheBird956 shouldn't you have installed BIT prior to hard resetting? Or is it future mistakes?
-
@asgs yeah I should have, but wasn't aware it existed. I'm still a bit new with Linux as my development OS
-
ddephor45116yNever did a hard reset before? How do you do your release builds then. I always empty the root folder and do a hard reset to get a really clean build.
-
endor57516yProtip: make a copy of the project folder, they try whatever risky business you want inside the copy and check the results.
If everything went well, push the changes and delete the duplicate folder; otherwise, delete the messed up copy and start over until you get it right. -
ddephor45116y@endor If you do that, you don't have to use git. Better learn to use git right. Everything that's committed or stashed, can be undone at least until the next garbage collection, as long as the .git folder is ok. For .git folder issues, you better push frequently.
If one loses more than a few hours of work on a horrible crash or human failure, it's time to optimize the workflow. -
devTea240886yGit reset hard only removes uncommited changes, commit early commit often, you can rebase -i later to fix the commit message
-
endor57516y@ddephor there are some things that even git won't protect you from, such as working with git reflog.
When trying to find the right strategy for a complex merge, I always make a copy of the project, in case I make any mistake (like copy-pasting the wrong commit sha when trying to undo a failed merge).
For small stuff, it's faster than actually bothering with pulling from remote and overwriting the local mess. Also avoids the potential need of push --force (in case of some significant branch/commit reworks).
Related Rants
-
PonySlaystation13"Don't use git, it is too complicated and we don't have time for this." 2 days later the same person made cha...
-
yulski8Guy from work: "I have a messy coding style ¯\_(ツ)_/¯". No, you have a bad coding style. Your repetitive ...
-
Caprico3My designer made this after overhearing a conversation DEVS were having.
Today I did 'git reset --hard'
Didn't go se well. Time to install BackInTime
rant
git gud