Speaking shortly after the incident in November 2021, the pilot known as Hux said he only had seconds to react.
An official investigation concluded the sudden loss of power on take off was probably caused by a cover being left on one of the aircraft's jet intakes.
His story is included in a BBC series called The Warship: Tour of Duty.
The documentary also reveals how the Royal Navy's HMS Queen Elizabeth ship was harassed by Russian aircraft and how it played a risky game of hide-and-seek with the Chinese Navy.
The Royal Navy pilot spoke to the film-makers shortly after he was rescued and was still suffering from cuts and bruises caused by the high-speed ejection.
He describes how the jet suddenly lost acceleration: "I tried for emergency power - that didn't work, then I tried to slap on the brakes - that didn't work either… so I kind of knew it was going to roll off the ship."
Hux's life was saved by his ejector seat - which he describes as the most advanced in the world. That and extremely good luck.
As his parachute activated, he says he saw the sea beneath him "and then a second later I could see the flight deck of the ship starting to appear beneath me".
He just managed to make it on to the deck - by a few feet - before being pulled to safety. If he had not landed on the carrier, he risked being dragged under the 65,000-tonne warship.
Leaked video from the ship's on-board camera showed the moment the F-35 fell into the sea.
It shows how the carrier was harried by missile-armed Russian aircraft in the eastern Mediterranean. F-35 jets are seen intercepting them to stop them getting too close to the carrier.
The documentary describes it as one step down from real combat. In the operations room a warfare officer suggests putting the Russian aircraft in their sights for a "theoretical kill" to warn them away.
F-35s are also put on standby when another ship from the carrier strike group, HMS Defender, has an even closer encounter with the Russians while sailing in the Black Sea.
In the South China Sea, HMS Queen Elizabeth engages in a game of cat and mouse with the Chinese Navy.
A Royal Navy frigate and helicopters try to find a Chinese submarine before it is able to get close enough to take a photograph from its periscope.
It is the kind of image that could be used for propaganda purposes - showing how easy it would be to target a large ship. But the submarine is successfully located using sonar before it gets too close.
Warship also tells the story of life on board during one of the Royal Navy's longest deployments during the Covid pandemic, where at the height of the outbreak about 400 sailors - more than a quarter of the crew - were in isolation with either confirmed or suspected infections.