One bad merge wiped out a whole week of work, here is what saved me
Last Tuesday I was working on a small project for a client and did a git merge without checking the branch first. Long story short, I overwrote 3 days of changes and spent the next 5 hours trying to undo it. The only reason I got it back was because I had made a backup zip file on a USB stick the night before, something I had never done before. My mentor always said commit early and commit often, but I thought I was being careful. Has anyone else had a merge disaster that taught them a lesson the hard way? What do you do now to prevent it?
Classic git move, thinking you're careful right up until the moment you nuke your own work. Lesson learned the hard way is still a lesson learned, and that USB backup was the real hero of the story. Now you know why your mentor kept saying commit often, it's way cheaper than five hours of panic.