In Harry Potter and the Chamber of Secrets we see that Nearly Headless Nick is petrified (for lack of better description) at one point by the basilisk:
It was Nearly Headless Nick, no longer pearly-white and transparent, but black and smokey, floating immobile and horizontal, six inches off the floor.
-Harry Potter and the Chamber of Secrets, Chapter Eleven (The Dueling Club).
I don't recall any mention of Nick recovering in CoS but he does make many appearances in the later books in the series, therefore we know that he does recover. Since he was a ghost he couldn't consume the mandrake potion directly.
Is there any indication of what is done to bring Nick back to his typical ghostly state?