this post was submitted on 06 Oct 2025
847 points (96.7% liked)

Programmer Humor

27720 readers
143 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

Yeah learned this the hard way.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Ephera@lemmy.ml 139 points 2 months ago (33 children)

I've had juniors who didn't believe this, so just to say it: If you know what you're doing, practically any Git problem is recoverable.

The one major exception is if you delete your local changes before committing them.

[โ€“] sucoiri@lemmy.world 3 points 2 months ago

Fun fact! If you added a file but never committed it you can still recover it with git fsck --lost-and-found. The changes were still added to the git object store, and by grepping through the dangling blobs you can find the object containing the changes you care about.

load more comments (32 replies)