When you said something in anger you regret
The Prophet ﷺ asked that any harshness of his be turned into mercy for the one who received it.
اللَّهُمَّ فَأَيُّمَا مُؤْمِنٍ سَبَبْتُهُ فَاجْعَلْ ذَلِكَ لَهُ قُرْبَةً إِلَيْكَ يَوْمَ الْقِيَامَةِ
Allāhumma fa-ayyumā mu'minin sabbabtuhu fa-jʿal dhālika lahu qurbatan ilayka yawma-l-qiyāmah.
“O Allah, whichever believer I have insulted, make that a means of drawing him nearer to You on the Day of Rising.”
He did not only ask forgiveness for himself. He asked that the person he had hurt be repaid for it.
The full narration
Narrated Abu Huraira:that he heard the Prophet (ﷺ) saying, "O Allah! If I should ever abuse a believer, please let that be a means of bringing him near to You on the Day of Resurrection
Source
Ṣaḥīḥ al-Bukhārī · 6361
Ṣaḥīḥ
- Agreed upon as authentic (al-Bukhārī / Muslim)