What car is it ??
If its a ford its fixed with a mirror patch , if its a vauxhall its a mirror boss glued onto the windscreen, others are similar
DO NOT try to push the mirror back on , it will crack the windscreen , !!!!
There is a nack to putting them back together , I normally scrape out the cupped end on the mirror , wd40 the hole and placed on a flat surface simply press it back together again
If you are nice to the windscreen people they will normally fix it back on for a nominal charge approx �8 + vat or if you tell them they fitted it some years ago and you can't find the reciept they may even do it for nothing ....