Abu Al-Wadi narrated that we were in a battle when one of our companions sold a horse to a man. When we intended to depart, he brought the dispute to Abu Barzah (may Allah be pleased with him). So Abu Barzah (may Allah be pleased with him) said: I heard the Messenger of Allah (ﷺ) say, "The two parties involved in a sale have the option (to cancel or confirm the sale) until they separate."
Hadith Referenceمسند الإمام الشافعي / كتاب البيوع / 1375
Hadith Takhrijاخرجه ابوداود، البيوع، باب في خيار المتبايعين (3475) - وابن ماجة، التجارات باب البيعان بالخيار ما لم يتفرقا (2182) - وصححه ابن الجارود (619)۔