The Swiss great suffered a painful loss at the hands of the giant South African in the Wimbledon quarter-finals this year after leading by two sets, his only defeat against him in five meetings before their match at London’s O2 Arena.
The six-time champion started the week with an uncharacteristically ragged display in a straight-sets defeat by Kei Nishikori but has beaten Dominic Thiem and Anderson in straight sets and is looking more like his old self as the tournament progresses.
The comfortable victory over Anderson in the Lleyton Hewitt Group takes Federer through to the semi-finals for the 15th time in 16 attempts at the season-ending finale and means he will likely avoid a meeting in the last four against in-form Novak Djokovic.
“I’m very happy,” said Federer. “The first match was tough against Kei, I never got going. With my back against the wall maybe it is easier for me to play.
“I tried to come up with a good game plan against Dominic and also Kevin today. I’m happy it all worked out. I’m thrilled to be in the semis.”
The first set was a topsy-turvy affair, with both players quickly into their groove on serve before a succession of breaks.
Federer, buoyed by his customary vocal support, broke to lead 4-3, only to lose his momentum immediately as Anderson levelled.
The Swiss broke the South African in the next game, sealing the break with a crisp backhand volley at the net but was immediately in trouble at 0-40 on his own serve before winning five successive points to take the set.
The second set went with serve until the seventh game, when Federer produced an immaculate sliced backhand that landed on the line to earn a break.
Now playing with freedom, the 37-year-old broke again to seal the victory and guarantee that he tops the group.
Earlier, Dominic Thiem beat Nishikori 6-1, 6-4 but both players will exit at the round-robin stage.
Top seed Djokovic is already through to the semi-finals after beating Alexander Zverev in the Guga Kuerten Group, with Zverev, Marin Cilic and John Isner battling for the other semi-final berth.
The world number one, aiming for a sixth ATP Finals title to pull level with Federer, plays Cilic on Friday while Zverev takes on Isner.