The most common cause of brief sensitivity to temperature, is when the root surface of the tooth becomes exposed due to recession of the gum. The enamel of your tooth is a dead material with no nerve endings. However, the inner dentine of the tooth, which the root is composed of, has millions of tiny tubules with nerve endings present in it. If these are exposed to temperature they will respond with a brief signal of pain.
Sensitive toothpastes can help to reduce this problem by blocking the tubules in the dentine, so reducing the sensitivity.
Prolonged and increased sensitivity can be a sign of dental decay, so seek your dentist’s advice if this occurs.