Ah yes, a bonk. Horrible experience. Happened to me once or twice, I never actually slept, but I had to essentially walk the rest of the way back. Always carry some gels, and fuel up properly at the start!
Yes, lesson learnt! A friend I was with actually realised they had glucose tablets with them for exactly this purpose, but unfortunately they didn't remember until past the time where they were needed.