Short answer: get enough gold to buy it back — and yes, that really is the mechanism.
Items you sell in Oblivion do not vanish. They go into that merchant's inventory, and you can purchase them again from the same vendor like anything else they stock. So the item is recoverable; the obstacle is purely financial, since you sold it for less than the shop now charges.
Two practical complications. First, shops have limited gold, which is the actual reason people lose items permanently — if the merchant's coin runs out before you buy back your gear, the stock sits there unsold until they restock, which can take in-game days. Second, if you sold to a vendor whose inventory is randomly generated rather than fixed, the item may be replaced and simply is not there any more.
The lesson for next time: check a merchant's remaining gold before selling anything you might want later.