Inappetance is most commonly a symptom of a biger problem, so understanding how to help a pet who won't eat will ensure that the animal doesn't suffer unnecessarily until he recovers or visits a veterinarian.
As soon as you feel ANY nip, pull away and say, "OW!" very loudly then, put your palm in their face and say, "NO!" also, very loudly. In fact, with ALL of these, ALWAYS reinforce the action with a verbal command.. such as "NO!" or "NO BITE!"