I'm so sorry to hear that, young Wizard. Once an item is sold to a regular shopkeeper it cannot be re-purchased. While I realize it's a long way off, the pumpkin heads will return for Hallowe'en.
Maybe this would be a good thing to add to the game professor. A buyback button added to vendors so that if you sell something by mistake you can buy it back. Maybe even go a step further and only allow items to be bought back in the same "session" that you sold it in. So lets say you sold it on accident you could immediately buy it back for the same amount but if you close the window and re-open it then you lose it. That might be something worth looking into.