Man thought nearly brain-dead recovers and leaves the hospital