The England No 1 was replaced in the first team by Costel Pantilimon for nine of 11 matches, beginning with the Capital One Cup victory over Newcastle on 30 October.
Pellegrini recalled Hart for the quarter-final victory at Leicester in the same competition.
He has retained his place since and claimed the man-of-the-match honours in Saturday's 1-0 win over Crystal Palace, in which he received a nasty cut to the eye in a collision with Cameron Jerome.
But Pellegrini has claimed the player himself knew he needed some time away from the spotlight after a series of poor performances.
"I did what I thought was best for the team and Joe Hart," he said.
"At that moment, Joe needed the rest. Maybe he would not say it, but he agreed with me. He realised it."
Pellegrini also praised Hart's positive response to losing his place in the team.
"Maybe some other players would have reacted in a bad way but he always reacted in a very good way," added Pellegrini.
"That is why he has returned for us in very good form.
"He is the best goalkeeper in England, a goalkeeper for a big team and he makes important saves.
"That is normal for him and why he is the number one in England."