It really depends on if you have any other health conditions, are pregnant or breastfeeding. I'd suggest you speak to your doctor or pharmacist before taking anything, however I can recommend a few things that you can ask them about.
The first would be an anti-inflammatory agent like ibuprofen. It will help bring the swelling down. If you are having trouble sleeping at night because of the toothache you can add a combinational product that has paracetamol (acetaminophen) + codeine + doxylamine which will help with any nerve pain, will relax you and help you sleep.
Most importantly however, see your dentist ASAP. If the pain disappears by itself it is a bad sign, not a good one. You may have a deep cavity or infection that will need to be treated properly before it gets any more complicated.