It is narrated from Abdullah bin Umar (may Allah be pleased with them) that the Messenger of Allah (peace be upon him) said: "The buyer and the seller both have the option (to cancel the transaction) as long as they have not separated from each other, except in the case of a sale with a stipulated option."
Hadith Referenceمسند الإمام الشافعي / كتاب البيوع / 1372