Hi,
Generally speaking wing mirrors are attached to their housings by "clip on" fittings. If the fittings (that are usually plastic) are not broken by the impact that detached the mirror you should be able to "snap" it back into place. If the fittings are broken it usually means buying a replacement fitting or whole mirror from an online breaker. Online breakers will match the colour and year of car to your request and mail it to you.
Cheers
westcountry, October 2013