Leaving in old code, commented out
I leave in old code but comment it out. I can quickly see the old code. The code can look a bit messy. Other people might look at old versions in the source control system instead.
What I learnt about JavaScript, HTML and CSS while developing the 'British Bingo' game (on SourceForge)