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.
quran:2:106

We do not abrogate a verse or cause it to be forgotten except that We bring forth ˹one˺ better than it or similar to it. Do you not know that Allah is over all things competent?  

When the disbelievers began to deride the matter of abrogation, saying that one day Muhammad enjoins his Companions to one thing and then the next day he forbids it, God revealed: And whatever verse (mā is the conditional particle), that has been revealed containing a judgement, We abrogate, either together with its recital or not ˹that is only its judgement, but its recital continues˺; there is a variant reading, nunsikh, meaning ‘˹Whatever verse˺ We command you or Gabriel to abrogate’, or postpone, so that We do not reveal the judgement contained in it, and We withhold its recital or retain it in the Preserved Tablet; a variant reading ˹of nunsi’hā˺ is nunsihā, from ‘to forget’: so ‘˹Whatever verse We abrogate˺ or We make you forget, that is, We erase from your heart’; the response to the conditional sentence ˹begun with mā˺ is: We bring ˹in place˺ a better, one that is more beneficial for ˹Our˺ servants, either because it is easier ˹to implement˺ or contains much reward; or the like of it, in terms of religious obligation and reward; do you not know that God has power over all things?, including abrogating and substituting ˹verses˺? (the interrogative here is meant as an affirmative).
القرآن:٢:١٠٦

مَا نَنْسَخْ مِنْ آيَةٍ أَوْ نُنْسِهَا نَأْتِ بِخَيْرٍ مِنْهَا أَوْ مِثْلِهَا ۗ أَلَمْ تَعْلَمْ أَنَّ اللَّهَ عَلَىٰ كُلِّ شَيْءٍ قَدِيرٌ  

ولما طعن الكفار في النسخ وقالوا إن محمداً يأمر أصحابه اليوم بأمر وينهى عنه غداً نزل: {ما} شرطية {ننسخ من أية} أي ننزل حكمها: إما مع لفظها أو لا وفي قراءة بضم النون من أنسخ: أي نأمرك أو جبريل بنسخها {أو ننسها} نؤخرها، فلا ننزل حكمها ونرفع تلاوتها أو نؤخرها في اللوح المحفوظ وفي قراءة بلا همز من النسيان أي ننسها، أي نمحها من قلبك وجواب الشرط {نأت بخير منها} أنفع للعباد في السهولة أو كثرة الأجر {أو مثلها} في التكليف والثواب {ألم تعلم أن الله على كل شئ قدير} ومنه النسخ والتبديل، والاستفهام للتقرير.