Hadithcore
Riyad as-Salihin, 5

Ma'n bin Yazid bin Akhnas (May Allah be pleased with them) (he, his father and his grandfather, all were Companions) reported:

My father set aside some dinars for charity and gave them to a man in the mosque. I went to that man and took back those dinars. He said: "I had not intended you to be given." So we went to Messenger of Allah (ﷺ), and put forth the matter before him. He said to my father, "Yazid, you have been rewarded for what you intended." And he said to me, "Ma'n, you are entitled to what you have taken." <b>[Al- Bukhari]</b>.

وعن أبي يزيد معن بن يزيد بن الأخنس رضي الله عنهم، وهو وأبوه وجده صحابيون، قال‏:‏ كان أبي يزيد أخرج دنانير يتصدق بها فوضعها عند رجل في المسجد فجئت فأخذتها فأتيته بها، فقال‏:‏ والله ما إياك أردت، فخاصمته إلى رسول الله صلى الله عليه وسلم فقال‏:‏ ‏

‏ لك ما نويت يا يزيد، ولك ما أخذت يامعن‏

‏ ‏(‏‏(‏رواه البخاري‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Introduction, Hadith 5
Sharh · explanationclick to expand
<b>Guidance from the Hadith:</b><br> 1) Actions are recompensed according to the intentions behind them, and the individual shall receive the reward of what he intended even if the outcome was contrary to his intention.<br> 2) It is permissible to give out charity in public if there is a benefit in making the charity public.<br> 3) It is permissible for the father to give his child from the Zakah due on him if the child is eligible to receive Zakah, provided that the father does not intend thereby to waive the obligation upon him to provide for his child.
Related hadiths1
Compare isnād across 1 related chains →