Bava Basra5: 6
אַרְבַּע מִדּוֹת בַּמּוֹכְרִין: מָכַר לוֹ חִטִּים יָפוֹת וְנִמְצְאוּ רָעוֹת — הַלּוֹקֵחַ יָכוֹל לַחֲזוֹר בּוֹ. רָעוֹת וְנִמְצְאוּ יָפוֹת — מוֹכֵר יָכוֹל לַחֲזוֹר בּוֹ. רָעוֹת וְנִמְצְאוּ רָעוֹת, יָפוֹת וְנִמְצְאוּ יָפוֹת — אֵין אֶחָד מֵהֶם יָכוֹל לַחֲזוֹר בּוֹ. שְׁחַמְתִּית וְנִמְצֵאת לְבָנָה, לְבָנָה וְנִמְצֵאת שְׁחַמְתִּית; עֵצִים שֶׁל זַיִת וְנִמְצְאוּ שֶׁל שִׁקְמָה, שֶׁל שִׁקְמָה וְנִמְצְאוּ שֶׁל זַיִת; יַיִן וְנִמְצָא חֹמֶץ, חֹמֶץ וְנִמְצָא יַיִן — שְׁנֵיהֶם יְכוֹלִין לַחֲזוֹר בָּהֶן.
There are four rules for dealing with sales: [If] he sold him superior wheat and it was found to be inferior, the buyer can retract. [If he sold him] inferior [wheat] and it was found to be superior, the seller can retract. [If he sold him] inferior [wheat] and it was found to be inferior, [or] superior [wheat] and it was found to be superior, neither can retract. [If he sold him] red [wheat] and it was found to be white, [or] white [wheat] and it was found to be red; [or he sold him] olive wood and it was found to be sycamore, [or] sycamore and it was found to be olive; [or he sold him] wine and it was found to be vinegar, [or] vinegar and it was found to be wine —- both of them can retract.