What exactly does it mean? And what is the origin of the phrase "hedge your bets"?
To "hedge your bets" means to reduce or mitigate your risk. According to Etymology Online, this usage of hedge has been around since the 1600s.
From this page, the origin of the phrase comes from an actual hedge or plantings that act as a fence to enclose a piece of land. A hedge delimits an area, so the idea of a limited risk arose from that concept. An older expression, "to hedge in a debt," supports this origin.
The figure of speech “to hedge one’s bets”, whether it be in relation to a market investment or a wagering game “bet investment”, derives—albeit sometimes loosely speaking—as an allusion to “fencing in” so as to prevent loss by escape (a form of guarding or protection), as if with hedgerows or similar planting arrangements. The chief characteristic of a “hedged” bet/investment is that it requires a (generally profit reducing) counter-endeavor—a likely-to-be countervailing bet, investment, operation—so that the net gain expectation, if any, is knowingly lowered in order to avoid or minimize net loss. To say that one’s bets are hedged (in the sense of a generally low-growing planted barrier) as opposed, for instance, to saying that they are walled in, is to say that a hedged investment remains, to some degree, exposed to adverse influences, even loss, from within or without the partial, protective “hedge” screen.
I can't back this up with reference but, from experience, when planting a hedge, it wise to plant some "spare" plants elsewhere. A common rule of thumb is one spare for every twenty plants in the hedge. This 5% of spares are there to replace any failures in the hedge plantings as, obviously, the occasional failed plant is going to seriously detract from the value of the hedge. I've often wondered if this is the origin of the expression? You are making a small investment in potentially unwanted plants to protect your larger investment in the hedge.