"[Yesterday] was a battle. I had to somehow dig and fight and sometimes these wins are more rewarding than just leading from the get-go," Federer said.
"I just had a tough time really getting into it and he was rock solid, so he deserved that first set, but the reaction from me was really important."
Two-time Swiss Indoors champion Juan Martin del Potro survived a battle with Spain's Roberto Bautista Agut to move to his third straight semifinal of the season.
The fourth-seeded Argentine will play holder Marin Cilic, who needed three hours to hold off 100th-ranked Hungarian qualifier Marton Fucsovics 7-6 (7-3), 5-7, 7-6 (7-4).
Del Potro, now suffering with minor pain after a long stretch of matches, reached the semifinals this month in Shanghai and won a second Stockholm title last weekend in a late-season hot streak.
He spoke with the trainer at one point about back pain but the niggle did not stop him continuing the match.
"I have pain in my back, hips, knees, wrist," he said. "I've been playing a lot of matches but I can still stand, so that's a good thing.
"But I'm not putting my body at risk if I play tomorrow or next week. I speak a lot about fitness with my team. There is no risk to keep on playing. I will be ready for [today], it will be a challenge for me. I'm glad to reach the semifinals of this event again."
Del Potro has a chance to qualify for next month's eight-man ATP Finals in London should he lift a third Basel title to go with the pair he won over Federer in 2012 and 2013.