What does it mean if you are petting your guinea pig on the head and it suddenly jerks its head up?

I think this means that she or he is agitated about something, and it is saying to "LEAVE ME ALONE"