Mishkat al-Masabih 3362
‘Ali said:
God’s Messenger presented me with two youths who were brothers, and when I sold one of them God’s Messenger asked me, “What has happened to your young man, ‘Ali?” When I told him he said, “Get him back, get him back.” 

Tirmidhi and Ibn Majah transmitted it.
وَعَنْ عَلِيٍّ رَضِيَ اللَّهُ عَنْهُ قَالَ: وَهَبَ لِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ غلامين أَخَوَيْنِ فَبعث أَحدهمَا فَقَالَ لي رَسُول صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «يَا عَلِيُّ مَا فَعَلَ غُلَامُكَ؟» فَأَخْبَرْتُهُ. فَقَالَ: «رُدُّهُ رُدُّهُ» . رَوَاهُ التِّرْمِذِيّ وَابْن مَاجَه