Of course, being the 70's, I suspect there was some mary-jane involved. Sounds like a pothead move.
Regardless, WOZ had to reenter the entire program from memory. It was said that the finished product not only functioned well, but was "art".
There is something to be said for trashing a design and starting over. -BZ
It's the "big" version of typing in a long program/article/story and losing it all to a crash/power failure/error--putting the loss behind you and re-entering it goes much faster than the original effort, and with better results, as many improvements are made in the process!