I heard the Messenger of Allah ﷺ say, "O Allah, Muhammad is only a human being who becomes angry as people become angry. I have made a covenant with You that You will not break with me. So whichever believer I have harmed, insulted, or lashed, make it for him an atonement and a means of nearness by which he draws closer to You on the Day of Resurrection."In another wording, "Make it for him a prayer, a purification, and a means of nearness by which he draws closer to You on the Day of Resurrection."
سمعت رسول الله ﷺ يقول: اللهم إنما محمد بشر يغضب كما يغضب البشر، وإني قد اتخذت عندك عهدا لن تخلفنيه، فأيما مؤمن آذيته، أو سببته، أو جلدته، فاجعلها له كفارة وقربة تقربه بها إليك يوم القيامة. وفي لفظ: فاجعلها له صلاة وزكاة وقربة تقربه به إليك يوم القيامة
Muslim narrated it in the Book of Righteousness and Kinship Ties (2601:91), from Qutayba bin Saeed, who said, Layth narrated to us, from Saeed bin Abu Saeed, from Salim, the freed slave of the Nasris, who said, I heard Abu Hurairah say what has been mentioned.He also narrated it (2601:90), from Qutayba bin Saeed, who said, Mughira (meaning Ibn Abdul-Rahman Hizami) narrated to us, from Abu Zinad, from Araj, from Abu Hurairah, in a similar manner. It contains the second wording.