قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " اللَّهُمَّ إِنِّي أَتَّخِذُ عِنْدَكَ عَهْدًا لَنْ تُخْلِفَهُ، إِنَّمَا أَنَا بَشَرٌ، فَأَيُّ الْمُؤْمِنِينَ آذَيْتُهُ أَوْ شَتَمْتُهُ أَوْ جَلَدْتُهُ أَوْ لَعَنْتُهُ، فَاجْعَلْهَا صَلاةً وَزَكَاةً وَقُرْبَةً تُقَرِّبُهُ بِهَا يَوْمَ الْقِيَامَةِ "
And the Messenger of Allah, peace and blessings be upon him, said: "O Allah! I make a covenant with You, which You will never break. I am but a human being, so if I have caused harm to any believer, or spoken harshly to him, or punished him, or cursed him, then make all of this a means of mercy, purification, and nearness for him, by which You bring him close to Yourself on the Day of Resurrection."
Related hadith on this topic