The Prophet of Allah ﷺ said, "The buyer and seller each have the right to cancel the transaction until they part ways, or until each of them takes from the sale what he desires." And they may give one another the choice three times.
أخبرنا عمرو بن علي قال حدثنا معاذ بن هشام قال حدثني أبي عن قتادة عن الحسن
أن نبي الله ﷺ قال البيعان بالخيار حتى يتفرقا أو يأخذ كل واحد منهما من البيع ما هوي ويتخايران ثلاث مرات