Hadithcore
Sahih Muslim, 344
sahih

Abu al. 'Ala' b. al-Shikhkhir said:

The Messenger of Allah (ﷺ) abrogated some of his commands by others, just as the Qur'an abrogates some part with the other.

حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُعَاذٍ الْعَنْبَرِيُّ، حَدَّثَنَا الْمُعْتَمِرُ، حَدَّثَنَا أَبِي، حَدَّثَنَا أَبُو الْعَلاَءِ بْنُ الشِّخِّيرِ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يَنْسَخُ حَدِيثُهُ بَعْضُهُ بَعْضًا كَمَا يَنْسَخُ الْقُرْآنُ بَعْضُهُ بَعْضًا ‏.‏

References2 variants
In-Book Reference
Book 3, Hadith 99
USC-MSA web (English) reference
Book 3, Hadith 675 (deprecated numbering scheme)
Sharh · explanationclick to expand
Islamic legislation is always in harmony with the nation, especially those who lived and grew up during the pre-Islam period. Out of establishing the principle of graduation, it sometimes abrogates some established rules. In this hadith, Abdullah ibn Ash-Shekhir, one of Basra scholars, confirmed this principle with relating to the Prophet's Sunnah. It was legislated at the beginning that ablution was sufficient for a Muslim who had intercourse with his wife without ejaculation, as in the two Sahihs that Ubayy ibn Ka’b said, "I asked the Messenger of Allah (ﷺ) about a man who had intercourse with his wife but left her before orgasm. He said, 'He should wash what he had (on his body) from his wife (her discharge), perform ablution, and offer prayer.'" Later, it was abrogated and established that bathing is obligatory after intercourse, whether or not, a person ejaculates. The Prophet (ﷺ) said, "If he sits between her four limbs, bathing is obligatory.” (Bukhari & Muslim) As for the Quran, it was, at the beginning, established that a woman is confined to her home as a punishment if she commits adultery. Allah, the Almighty, says, "And those of your women who commit illegal sexual intercourse, take the evidence of four witnesses from amongst you against them; and if they testify, confine them (i.e. women) to houses until death comes to them or Allah ordains for them some (other) way." (An-Nisa) It was later abrogated by the verse, "The fornicatress and the fornicator, flog each of them with a hundred stripes." (An-Nur: 2) Also, the Prophet (ﷺ) clarified this rule and said, "Learn from me. Allah has ordained for them another way. A virgin is punished with one hundred lashes and exiled for one year. A Thayyib (divorcee or widow) is punished with one hundred lashes and stoning.” (Narrated by Muslim) Finally, this hadith shows the interest of the Companions' students to study the Prophetic Sunnah, including the cases of abrogation..