A man who was beaten up and robbed managed the impressive feat of walking seven miles home to safety in the early hours.