When you see these things, ease off the petting and just enjoy your cat’s presence without touching him for a while.
You can also work off some of your cat’s restlessness by handing him a stuffed animal to bite, lick and bunny kick, or by engaging him in a play session with a fishing-pole toy.