Hart came under heavy criticism after two mistakes in City's Champions League loss to Bayern Munich earlier this month.
They were merely the latest of a catalogue of errors to have blighted the England keeper's performances in an indifferent 12-month period.
But since then Hart has come through a tough test from Everton in the Barclays Premier League and England's triumphant final two World Cup qualifiers against Montenegro and Poland without further damage.
Pellegrini feels the international games, having received the full backing of England boss Roy Hodgson, were especially important for the 26-year-old's confidence.
Pellegrini said: "I think both games for him were very, very important.
"He was in his worst moment before the two international games. I think that he showed that he has the personality to do well even in his worst moments.
"I suppose he will improve in confidence and all of us trust him."
Pellegrini had said prior to the Everton game that Hart, like any other player, was not immune to being dropped.
The Chilean, however, stuck with Hart, whose emotional reaction at the final whistle against Everton gave an indication of the tension he had been feeling.
When asked if Hart's fist-pumping had revealed a release of pressure, Pellegrini said: "Yes, because it was a very difficult game for him.
"I am sure that I made the right decision to keep him and Joe showed me it was the best decision.
"It (the reaction) was (for) all together - the fans, the other players and the staff.
"All were very close with him because it was a very difficult moment."
Pellegrini is pleased that Hart, along with a number of his team-mates, could now be playing in the World Cup in Brazil next summer.
He feels the incentive of playing at the tournament will help bring out the best in his players.
He said: "I think, for the players, it's very important they qualify for the World Cup.
"I think it's the most important thing in football so all of them that have are very happy.
"And of course they all want to arrive in their best form for the World Cup."
Striker Edin Dzeko was pictured in tears after helping Bosnia qualify for the World Cup for the first time in midweek.
Pellegrini said: "I am happy for him and Bosnia.
"He's a little bit tired but for Bosnia and for him it's very important.
"I hope we will see the best of him in the rest of the season."