Bradley Wiggins considered pulling out of the Tour de France before going on to win in 2012, according to former Team Sky sports director Sean Yates.
Wiggins, who was Sky team leader, saw team-mate Chris Froome, this year's champion, launch an unplanned attack in the closing stages of stage 11.
Yates' book, serialised in the Times, claims Wiggins, 33, suggested in a text he was contemplating quitting.
Yates said Wiggins wrote: "I think it'd be better for everyone if I went home."
Yates - whose job was to run things for Sky from the team car during a stage - said he and Team Sky general manager Sir Dave Brailsford had to talk Wiggins into remaining in the race, which he eventually won to become the first British man to win the Tour de France, with Froome coming home in second.
Wiggins felt "stabbed in the back" by Froome, according to Yates.
Sky had an agreement Froome would only attack in the final 500 metres and when he pulled away from Wiggins with four kilometres to go, his team ordered him to drop back to help his team leader.
Yates, who left Team Sky and retired from the sport in October 2012, added Wiggins "couldn't understand why [Froome] had gone back on the agreement, especially when everything was going so well".
"His mental state was always fragile, and that psychological blow could have been a knockout one," Yates wrote.
Wiggins and Froome have both been named in Great Britain's longlist squad for September's Road World Championships.