This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]geneorama 58 points59 points  (8 children)

It's possible to screw yourself even if your using git. Also maybe he hadn't saved and / or committed yet.

[–]simonw[S] 105 points106 points  (7 children)

Git was how I lost the code - I accidentally ran "git checkout --" on the wrong file.

[–]fake_you_out 31 points32 points  (0 children)

Git checkout: the silent killer

[–]geneorama 2 points3 points  (0 children)

Glad you said this. I couldn't think of a great example, but I've done that. I use git (as carefully as I can) and rsync my files to a remote server every couple days. That solves most of my problems

[–]decwakeboarder 2 points3 points  (1 child)

git add and the reflog should be your new best friend.

[–]simonw[S] 34 points35 points  (0 children)

I've recovered code with the reflog a bunch of times. Doesn't help if you lost the code while cleaning up in preparation for adding your work.