ProgrammerHumor

myStashOhMyPreciousStash

myStashOhMyPreciousStash
https://i.redd.it/ae0kbzwkhgcf1.png
Reddit

Discussion

Sad_Cup_1324

Junior post. Senior comments.

6 hours ago
Nervous_Teach_5596

Too much juniors this days

4 hours ago
programmerbud

Senior Dev:
"You forgot the 5th horseman: giving ```chmod -R 777 /``` in production because 'it wasn’t working'."

3 hours ago
Unupgradable
:cs::ts:

git reflog

7 hours ago
diffyqgirl
:s:

My life got so much better when I learned about git reflog

7 hours ago
mirrax

My life got less fun when I learned that it's pronounced "ref log" rather than a way to beat git into submission.

6 hours ago
diffyqgirl
:s:

With the number of times its fixed my repo, por que no los dos?

5 hours ago
rosuav

I mean, I'm not going to force you to pronounce it "ref log" if you prefer the alternative!

3 hours ago
mirrax

Oh good. How about mispronouncing fstab?

1 hour ago
rosuav

There are two valid ways to pronounce it. One is: /etc/fs<tab> which is the way I type it (since "fs" is a unique prefix within my etc directory). The other is entirely valid and probably more accurate when things are going wrong. Go ahead, stab that f.

41 minutes ago
gimme_pineapple

git reset --hard HEAD@{1}

7 hours ago
tyler1128
:cp::rust::py:

git reset --hard only moves the HEAD pointer. You can always go back unless you orphan some commits and wait long enough that the git garbage collector removes them. git reset --hard HEAD@{1} will go back to where you were. If you move HEAD multiple times, you can use a different number to go to N heads ago.

7 hours ago
sciolizer

git reset --soft only moves the HEAD pointer. All other modes can potentially affect the index or working copy.

4 hours ago
UpgrayeddShepard

This is the actual correct answer.

3 hours ago
G0FuckThyself

Tell me you don't know git without telling me you don't know git.

6 hours ago
Minimum_Session_4039

Did this the other day, was at the point where I just wanted to start over from scratch haha

7 hours ago
canihelpyoubreakthat

If only there was some sort of log of your refs 🤔

4 hours ago
ColaEuphoria
:c::cp::py::asm::rust:

git push origin master

git reset --hard HEAD~3

git gc

git push --force

6 hours ago
DarkShadow4444

Still doesn't delete the history - reflog will be kept. Unless you manually expire it.

5 hours ago
VEryFatfellow OP

I am now let go from my toxic bank dev job, thanks to you.

6 hours ago
ColaEuphoria
:c::cp::py::asm::rust:

git rebase -i --root

<delete random `pick` lines near the beginning of time>

git gc

git push --force origin master

5 hours ago
WhyTheOverlyLongName

Just commit your .git directory in git. #shittylifehacks

5 hours ago
RockVirtual6208

copy your entire repo on a backup hard drive smh. 3-2-1 rule people!

2 hours ago
Striking-Jaguar-9993
:js:

All seniors in comment section ⭐⭐⭐⭐⭐

4 hours ago
usrlibshare

reflog says hi

7 hours ago
IuseArchbtw97543
:c::bash::j:

kid named backups

7 hours ago
8threads

git push -f

7 hours ago
0xlostincode

rm -rf .git

would be more catastrophic

6 hours ago
ChalkyChalkson

How about randomly changing history and pushing?

6 hours ago
ramriot

// # Les carottes sont cuites

6 hours ago
Shekowaffle

Putting toothpaste back in is not that difficult

6 hours ago
Apprehensive-Ad2615

bah, Idk how that would be any way difficult to undo, you just need to get the last commits back from the repo and then point again to the new HEAD.

4 hours ago
Sibula97

If it was an unpushed commit that won't work, but you can always git reflog. And then reset to the head before you reset.

1 hour ago
Apprehensive-Ad2615

knowledge, I have forgotten that no everyone pushes as soon as the commit is done

2 minutes ago
moroz_dev

Just use jj instead of git

5 hours ago