When there is decay in a tooth, it requires cleaning and for a filling to rebuild the tooth. Sometimes the nerve in the tooth can become irritated following a filling, especially if the decay is deep. The easiest way to treat this is to use desensitising paste over the tooth. Rub a small pea sized amount onto the tooth and leave it in place overnight.
If the pain becomes constant, is worse with hot drinks or keeps you awake at night, you might require further treatment in the tooth, such as a root canal filling.