It’s that sudden moment of realisation that the copy and paste you’ve just done has over written a newer version of a file and you don’t have a backup! All you want to do is cry out loud but when you’ve have no backup no one can hear you scream.
This happened to me recently (I know; you should always work with a backup but I was just making a quick change and thought it wouldn’t be a problem) and I copied over a CSS file that contained site specific styling and subsequently lost the formatting that had taken a fair while to put together. I’d like to point out that this happened on our development server so no live sites were affected but the situation could very well apply.
I was stunned into silence for at least 20 seconds before coming to terms with my heinous error and getting on the internet to try and retrieve a cached version of the file from one of the many browsers on my machine. This is something that I remember doing in the past and was hoping it would help me out again. However my browsers had other thoughts and were proving to be less than helpful:
IE7 seems to be deleting my session cache once I close the browser down. I had already deleted the Firfox cache whilst making the CSS changes that I copied over. I was going to look at Safari as a last resort so turned to Google Chrome. This proved to be my lifeline as a quick trawl through the search pages returned for: “cached css files chrome” gave me this: ChromeCacheView.
The small exe file runs up and interrogates the cached indexing history for the browser and displays a list of all the content you have viewed, including Filename, URL, Type etc. From this (large!) list of content I spotted the CSS file I was after and using F4 copied the file to a location on my desktop from where I could view its contents. Although it was an out of date copy it did provide me with the much needed complex styling I was after.
So, after taking some time to reinstate the changes lost, I was able to recreate the CSS and the website was back to the way it was without anyone noticing.
Of course for the eagle-eyed amongst you the lesson for today is: Think twice before copying over a file and never, ever do anything without a backup.Tags: backup, browser, cache, CSS, Development