Yaya Toure was handed a start in the midfield along with Bernado Silva, while Aguero had settle for a spot on the bench.
Joe Bryan almost found the opening goal for the visitors in the 16th minute for Bristol after after hitting a snap shot from outside the box that was saved by Claudio Bravo in the top corner, while Kevin De Bruyne forced a great save out of Frank Fielding 15 minutes later.
However, John Stones conceded a penalty three minutes before halftime after bringing down Bobby Reid inside the box. Reid capitalised to give Bristol the lead from the spot-kick, 0-1.
The equaliser arrived 10 minutes into the second half as De Bruyne started a move and finished it, after receiving a return pass from Raheem Sterling before firing past Fielding with a fine finish.
Guardiola introduced Sergio Aguero in the 70th minute in place of Yaya Toure as he was seeking the winning goal.
With six minutes remaining, Reid collected a knockdown and went for a strike on a half-volley but he guided his effort well over the bar.
However, Aguero dramatically headed home the winner in stoppages following a pin-point cross from Bernardo Silva to seal a 2-1 win.