Glitches and Resets

I don’t know how I survived before I used Git. Seriously, I would have multiple versions of every program named things like “sortaWorks1”, “finished”, “finished2”, or my favoirite “reallyActuallyFinished3”. Who knows what any of these mean in terms of progress, or what bugs they contain. Now that I am using git I can know with certainty where I am at, and more importantly, that I can easily get back to a working version.

Today was one of those days. Between being a little too tired, and trying to logic my way through some refactoring, I hit a dead end. Not only could I not see where I was trying to go with the refactor, but I noticed that somehow a bunch of my code had gotten mangled by intellij(or more likely by me, but I want to blame intellij right now). It was time to throw in the towel.

In the past this would have been panic time. Did I remember to make a copy of all of my code? Did I save over the last working version I had? Do I remember which version was actually the good one? NOOOOOOO!

Even though it pains me a little to throw away work, no matter how bad it is, I have learned that sometimes it is better to start fresh than to get stuck in a code swamp. So after accepting that I had gone down a wrong path, I took a deep breath and did a git reset, and viola, back to working code and passing tests. An hours worth of changes reverted in a matter of seconds, and now I can go home knowing that I can start fresh tomorrow.