When deep cavities are in the nerve, a pulpotomy is the removal of the irritated part of the tooth pulp.