The whole world talks about what to do when planning a pregnancy but no one thinks about the woman who really didn't have time to plan one and fell pregnant just like that! You would have thought that having an unplanned pregnancy is probably your worst nightmare especially so because you couldn't do all the right things you were supposed to be doing had your pregnancy been planned. There is just one piece of good advice for you - RELAX!
There is no reason to panic. If you were drinking, smoking a bit too much, taking too many medicines or even had an x-ray before realising you were pregnant, consult your doctor first before taking any drastic steps. In a vast majority of the cases, such incidents cause no harm to the unborn baby.
Have a look at the first five steps of the pre-pregnancy checklist and don't worry about what you could have done but focus on what can be done now like starting folic acid, eating a well-balanced diet etc.