After wins at the Australian Open as well as Indian Wells and the Miami Open earlier this year, Federer decided to miss out the clay-court season - seen as a move to enhance his prospects at WImbledon, on his favoured grass surface.
However, doubt was cast on his comeback last week as he lost his first competitive grass court match of the season, to 39-year-old Tommy Haas.
Federer thrashes Zverev to claim ninth title at Halle in style
But a week on and Federer looked in better nick, dispatching Zverev with relative ease in Germany.
Though the Swiss squandered three set points at 5-4 in the first set, and appeared to be lacking some of his sharpness, he managed to win the tiebreak by whipping a crosscourt backhand winner on his fourth set point.
Zverev's first serve seemed inconsistent and Federer broke at 4-4 in the second set to break the German, before serving out the match.
Federer will face defending champion Florian Mayer in the quarter-finals.
Additional reporting by Reuters.
Federer moves into 140th career final at Halle
Federer eases past Mayer to reach Halle semi-finals