Language:
كتاب الحدود
86  
Limits and Punishments set by Allah (Hudood)
(10)
Chapter: To carry out the legal punishment; and to take revenge on those who transgress Allah’s limits and boundaries
(10)
باب إِقَامَةِ الْحُدُودِ وَالاِنْتِقَامِ لِحُرُمَاتِ اللَّهِ
Sahih al-Bukhari 6786

Narrated Aisha:

Whenever the Prophet (ﷺ) was given an option between two things, he used to select the easier of the tow as long as it was not sinful; but if it was sinful, he would remain far from it. By Allah, he never took revenge for himself concerning any matter that was presented to him, but when Allah's Limits were transgressed, he would take revenge for Allah's Sake.

حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، حَدَّثَنَا اللَّيْثُ، عَنْ عُقَيْلٍ، عَنِ ابْنِ شِهَابٍ، عَنْ عُرْوَةَ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ قَالَتْ مَا خُيِّرَ النَّبِيُّ صلى الله عليه وسلم بَيْنَ أَمْرَيْنِ إِلاَّ اخْتَارَ أَيْسَرَهُمَا، مَا لَمْ يَأْثَمْ، فَإِذَا كَانَ الإِثْمُ كَانَ أَبْعَدَهُمَا مِنْهُ، وَاللَّهِ مَا انْتَقَمَ لِنَفْسِهِ فِي شَىْءٍ يُؤْتَى إِلَيْهِ قَطُّ، حَتَّى تُنْتَهَكَ حُرُمَاتُ اللَّهِ، فَيَنْتَقِمُ لِلَّهِ‏.‏
Reference : Sahih al-Bukhari 6786
In-book reference : Book 86, Hadith 15
USC-MSA web (English) reference : Vol. 8, Book 81, Hadith 777
  (deprecated numbering scheme)