My bosses at my startup immediately recognized it and told me to take several days off. Since then, I've consistently made personal time everyday to keep my perspective in check: read a book in the morning, workout in the afternoon, meditate for 5 minutes, and leave work promptly after the expected amount of hours.
To get myself back into "beast mode" (which others would call "the zone"), I've done what some other commentors suggested: learn something new. For me personally, I decided to take on essentially low priority micro-projects within my startup that are interesting problems (i.e. integrating DynamoDB within an EventMachine process). I've built up my confidence back to near what it was before, and I'm feeling damn good these days.