It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: The seller and the buyer (the one who sells and the one who buys) have the option (to cancel the transaction) as long as they do not separate, or unless it is a sale with a stipulated option.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 8099
Hadith Gradingحکم دارالسلام:صحيح لغيره، وهذا إسناد ضعيف لضعف أيوب