Brett Archibald will never forget the feeling of doom while watching a charter boat sail away into darkness after he fell overboard in the Indian Ocean while on a trip with friends.

"I've got goosebumps just reliving it,'' he told TODAY. "And then I lifted my head and just realized, 'You're never going to catch a boat.' And (I) just knew it was over."

It was the beginning of an odyssey of survival for the then-50-year-old South African father of two, who battled sharks, jellyfish, dehydration and hallucinations while treading water for almost 29 hours.

Archibald recounted his incredible tale for the final installment of TODAY's True Grit series. He also documented the experience in his book, "Alone: Lost Overboard in the Indian Ocean."

It began on a surfing trip with friends in the Mentawai Strait near Indonesia's West Sumatra province in April 2013.

One night, he and some friends got severe food poisoning. In the middle of the night, amid rain and wind, he got up from bed to get sick over the side of the boat. He became dizzy, lost his footing, and plunged into the sea.

Brett Archibald, right, during his rescue from the Indian Ocean in April 2013. The South African surfer fell off a charter boat during a trip with friends. TODAY

No one had seen him fall overboard. His first thought was that he was going to die.

"I knew it,'' he said. "There was no shadow of a doubt."

Archibald started to do the math, figuring it would be at least seven hours until his friends realized he was missing and about another seven hours until they were able to return to his location.

Trending stories,celebrity news and all the best of TODAY. This site is protected by recaptcha

As Archibald floated in the ocean, he began to talk to God.

"The first conversations were very anger-driven,'' he said. "I scream. I can't even use the profanities that I used in that ocean.

"And then they evolved to reassessing my life. I reflected, I hadn't been a good person. I thought I was a great father and husband, but when I was faced with reality, I hadn't been."

He then started reciting cell phone contacts and singing Elton John songs while swimming with the current to keep his mind occupied.

Thinking about his wife and two children, who were 6 and 9 at the time, helped Archibald survive, he said. TODAY

As the hours passed, he began to fight cramps, dehydration and the stings of jellyfish. Eventually, he began hallucinating.

"It was like a rainbow with no color coming out the sea, but then it was the Virgin Mary,'' he said. "It was bizarre. I knew it wasn't real."

Archibald thought a miracle rescue was about to happen when he saw the charter boat in the distance. He started screaming and waving.

"They weren't even as far as the length of this room,'' he said. "And then they sailed away."

That realization was crushing.

"I just lost it,'' he said. "I screamed at the world. I screamed at life."

It was at about that time that he felt a shark bump into him from below.

"I said, 'Okay, I want to meet my end,' and I went under the water,'' he said. "I just remember seeing him, going, 'Oh my God,' because magnified under the water, I thought it was the size of the red bus (in London)."

It turned out to be a blacktip reef shark that eventually lost interest and swam away. Following that encounter, Archibald decided he could not go on any longer.

"So I said all my goodbyes, swam down,'' he said. "I remember lying on my back and just going, 'Okay, just breathe.' And I just took a huge breath."

He started choking on the water and then swam to the surface, thinking he was seeing a vision of a black cross. It turned out to be the mast of the Barrenjoey, a boat that had joined the search party.

A hunch by Australian skipper Tony "Doris" Etherington about Archibald's whereabouts had paid off. After 28 1/2 hours at sea, he was rescued.

A medic onboard estimated that he only had about another hour to live if he wasn't rescued. Archibald lost 13 pounds during the ordeal.

Incredibly, he went back out on the surfing charter boat the very next day. He believes he was spared in order to change his life.

"And (to) share this story,'' he said. "Because life is short, and if you don't live it well, you have regrets. I had 28 hours of regrets, and I've got a second chance."

Follow TODAY producer Jennifer Long and writer Scott Stump on Twitter.