Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:2328aAbū Kurayb > Abū Usāmah > Hishām from his father > ʿĀʾishah

'A'isha reported that Messenger of Allah ﷺ never beat anyone with his hand, neither a woman nor a servant, but only, in the case when he had been fighting in the cause of Allah and he never took revenge for anything unless the things made inviolable by Allah were made violable; he then took revenge for Allah, the Exalted and Glorious.  

مسلم:٢٣٢٨aحَدَّثَنَاهُ أَبُو كُرَيْبٍ حَدَّثَنَا أَبُو أُسَامَةَ عَنْ هِشَامٍ عَنْ أَبِيهِ عَنْ عَائِشَةَ قَالَتْ

مَا ضَرَبَ رَسُولُ اللَّهِ ﷺ شَيْئًا قَطُّ بِيَدِهِ وَلاَ امْرَأَةً وَلاَ خَادِمًا إِلاَّ أَنْ يُجَاهِدَ فِي سَبِيلِ اللَّهِ وَمَا نِيلَ مِنْهُ شَىْءٌ قَطُّ فَيَنْتَقِمَ مِنْ صَاحِبِهِ إِلاَّ أَنْ يُنْتَهَكَ شَىْءٌ مِنْ مَحَارِمِ اللَّهِ فَيَنْتَقِمَ لِلَّهِ ﷻ  

See similar narrations below:

Collected by Aḥmad
ahmad:24034Muḥammad b. ʿAbd al-Raḥman al-Ṭufāwī > Hishām b. ʿUrwah from his father > ʿĀʾishah

[Machine] The Messenger of Allah ﷺ never struck a servant of his, nor a woman, nor did he ever strike with his hand, except when he was fighting in the cause of Allah. He never sought revenge for himself, except when the limits of Allah were violated, then he would seek revenge for the sake of Allah. And when two matters were presented to him, he would choose the easier of the two, as long as it was not sinful. If it was sinful, he would be the furthest person from it.  

أحمد:٢٤٠٣٤حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ الرَّحْمَنِ الطُّفَاوِيُّ قَالَ حَدَّثَنَا هِشَامُ بْنُ عُرْوَةَ عَنْ أَبِيهِ عَنْ عَائِشَةَ قَالَتْ

مَا ضَرَبَ رَسُولُ اللهِ ﷺ خَادِمًا لَهُ قَطُّ وَلَا امْرَأَةً لَهُ قَطُّ وَلَا ضَرَبَ بِيَدِهِ إِلَّا أَنْ يُجَاهِدَ فِي سَبِيلِ اللهِ وَمَا نِيلَ مِنْهُ شَيْءٌ فَانْتَقَمَهُ مِنْ صَاحِبِهِ إِلَّا أَنْ تُنْتَهَكَ مَحَارِمُ اللهِ ﷻ فَيَنْتَقِمُ لِلَّهِ ﷻ وَمَا عُرِضَ عَلَيْهِ أَمْرَانِ أَحَدُهُمَا أَيْسَرُ مِنَ الْآخَرِ إِلَّا أَخَذَ بِأَيْسَرِهِمَا إِلَّا أَنْ يَكُونَ مَأْثَمًا فَإِنْ كَانَ مَأْثَمًا كَانَ أَبْعَدَ النَّاسِ مِنْهُ