I'd imagine that they would simply start removing them from circulation.
To my knowledge, whenever there have been drastic revaluations, new revalued bills are introduced to prevent just the kind of speculation you mentioned. Sometimes they circulate alongside the old bills, but the old bills maintain their previous value (or lack thereof). So if you've got a $1,000,000,000,000 bill that is worth New$1, your $1,000,000,000,000 bill will still buy New$1 worth of goods.
Of course, economic growth can revalue an existing currency, but that is a very slow process that is often opposed by central banks.