The past two days have been a complete nightmare… I’m on an important deadline when I noticed some very strange posts appear on Afrigator. Posts from sites like Mashable and Boing-Boing. Wow! They like Afrigator that much that they’ve subscribed?! Although I’d love to believe that is the case, it simply was not true… I digress.
I started delving into our parser scripts trying to root out the problem on ground level. Make changes left, right and center. Testing, redo-ing, answering the phone, answering calls on Skype from my sweet love of my life, losing track of what I’ve done and BAM! things are a complete mess…
So, what would be the quickest solution? Start over and do it properly. At least, for me that is sometimes the best option. Now, if you’re having nightmare days, you’ll know when it happens that you bugger shit up so badly that you’ve completely forgot to make backups before you started breaking your months of hard work. Its that sickening sinking feeling…
Fortunately, Subversion (SVN) is not only for keeping revisions of your software, but actually allows you to go back to a snapshot of your code right about where you started doing the dumb stuff. There are a number of ways to recover, although this was what I did as a quick and dirty solution. Took me less than a minute.
Find what the revision number is before you mucked it up.
Export that revision to a different directory.
svn export http://svn.afrigator.com/trunk/ -r 4815
Copy the source file back to your working repository.
Check it in
svn ci -m "Fix the mess I made"
Viola! You’re good to go and start messing it up from scratch again!
Now I do know that the best way to prevent this from happening is to never have it happen in the first place, but hell, if and when it happens, be thankful that you’ve got SVN!