It is not permissible for the person who gave the gift to buy what he gave his brother. It was narrated that
`Umar (may Allah be pleased with him) said,
I gave a horse (to someone to use in jihad) for the sake of Allah, and its owner neglected it. I thought that he would sell it for a cheap price, and I asked the Messenger of Allah (peace be upon him) about that. He said, “Do not buy it from him even if he sells it to you for a dirham, for the one who takes back his charity is like the dog that goes back to its own vomit.
May Allah grant us success. May peace and blessings of Allah be upon our Prophet Muhammad, his family and Companions!