It is narrated from Sayyiduna Samurah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The buyer and the seller both have the option (to cancel) as long as they have not separated."
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 6808