The Messenger of Allah ﷺ said, "O Allah, I am only a human being, so whichever Muslim I have cursed or harmed, make that a means of purification and nearness for him."
حدثنا أسود حدثنا إسرائيل عن الأعمش عن أبي صالح
قال رسول الله ﷺ اللهم فإنما أنا بشر فأيما مسلم لعنته أو آذيته فاجعلها له زكاة وقربة
Its isnad is sahih. It was previously mentioned in 8184. Bukhari narrated something similar to it, 8/96, in the chapter on supplications, on the saying of the Prophet ﷺ, "Whoever I have hurt, make it a means of purification for him." Muslim narrated it, 4/2010, no. 2603, in the chapter on righteousness, on those the Prophet ﷺ cursed. And Ibn Abu Shayba narrated it, 10/339, no. 9600, in the chapter on supplication, on what has been mentioned about the Prophet ﷺ praying for one who cursed him.