Chris Quinlan was working on a Rochester Hills home Tuesday when the incident occurred, the Detroit Free Press reported.
Quinlan, who started roofing when he was 16, said he was working near the post that holds the main electrical line going into the house when his nail gun kicked back and into exposed electrical wires above, electrocuting him.
"All your muscles restrict and they lock up -- I remember all of that," he said. "I remember getting shocked and trying to move my arms and trying to break free."
A coworker whose name was not reported kicked Quinlan with both feet, knocking him off the roof.
"My last thought was, 'I'm going to die,'" Quinlan said. "Everything was black, and I could see the light flashing. And the next thing I know, I was on the ground. My vision comes back, and I'm sitting on the ground."
Quinlan didn't suffer any injuries other than black circles and small lacerations where he was electrocuted.
"It's like really a miracle -- I just thank God," said Quinlan, of Royal Oak. "The most deaths in construction are caused by falling off a roof or electricity and I survived both at the same time."
Quinlan said the incident won't deter him from pursuing his line of work.
"I definitely want to take a vacation soon," he said. "But I'm hooked up. I've got a roof to do tomorrow."