First, take a deep breath and remember that this sort of thing happens to everyone. Don't panic and you'll be fine.
Next, think about the way stitches are supposed to sit on the needle. Look at the loop and notice that it has a right "leg" and a left "leg." The right leg should be on the front of the needle.
Slip the stitches back on the needle they fell off of one at a time. Make sure you put them back on in the same order they were in, so that no stitches are twisted, no stitches are left off the needle and the first stitch on your needle is the same stitch that was there before the knitting fell off the needle.
If you aren't sure you've got your stitches mounted on the needle correctly when you go to knit the next row, you might feel that the stitch is much tighter than normal if you try to knit a stitch that is twisted. To fix this, either take the stitch off the needle, untwist it and slide it back onto the needle, or knit into the back of the stitch, which will untwist it.