Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) narrates from the Messenger of Allah (peace and blessings be upon him) that he (peace and blessings be upon him) said: "When two men make a sale, each of them has the option to cancel the deal as long as they have not separated, or if they have given each other the option and made the sale on that basis, then the sale is binding. If they separate after making the sale and neither of them has abandoned the sale, the sale is likewise binding."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب البيوع / 10433