Rosol, who defeated the Spaniard in 2012, had a set point for a two-set lead, but two-time champion Nadal recovered to come through 4-6, 7-6 (8-6), 6-4, 6-4.
According to the BBC, Nadal, who has reached the third round for the first time since 2011, will now face Kazakhstan's Mikhail Kukushkin in the last 32 on Saturday.
Nadal said that he knew he had to keep fighting, waiting for his moment, adding that he made a few mistakes but Rosol was serving very well. Two sets down against Rosol would have been very dangerous, he continued.
Nadal also said that he never plays for revenge, every match is a different match, adding that this had been another match he tried to win.
The Spaniard added that it is a great win for him, concluding that it is the best level he has played on grass since a long time and that this is very important news for him.