The Messenger of Allah ﷺ said, "The buyer and the seller have the option to cancel the transaction as long as they have not parted."
حدثنا أحمد بن عبدة وأحمد بن المقدام قالا حدثنا حماد بن زيد عن جميل بن مرة عن أبي الوضيء
قال رسول الله ﷺ البيعان بالخيار ما لم يتفرقا
Its chain of transmission is sahih. Abu Dawud narrated it in the Book of Sales, chapter on the option of the two parties to a transaction, no. 3457, from the hadith of Hammad, with the same wording, and Ibn Jarud graded it sahih, no. 619.