You might want to take this oppertunity to replace your mirror with a generic replacement. I found the $18 pep-boys kit to be an almost perfect match for the original, save the more generic rectangular metal tab that gets glued to the window. I replaced my OEM because the day/night switch wasn't working.
If you decide to just glue the old one back up, remove the metal button from the mirror - it should pry out; just as if you were sliding the mirror straight up. (in other words, pry the button down from what would be the top of the mirror mount if it were still on the windshield)
Before you glue the tab to the windshield, you need to clean everything very well - scrape any residue off the inside of the windshield with a razor blade, clean the glass with alcohol, and, if you're replacing the original circular button, sand off any glue residue with a fine grit paper.
Mark the location where you want the button on the outside of the windshield with a crayon or marker, then just follow the instructions in the kit - rub the little alcohol vial onto the windshield and button surfaces, a drop of glue on each, then press in place and hold it for a minute.