Some passages in the Quran have been abrogated by other verses that were revealed later. This concept is often used to resolve contradictions in the Quran. Because of this doctrine, great importance is placed on the time that the verse was revealed. A passage that was revealed in Medina, for example, may modify or even supplant one that was revealed earlier in Mecca.
Nothing of our revelation (even a single verse) do we abrogate or cause be forgotten, but we bring (in place) one better or the like thereof. 2:106
And when We put a revelation in place of (another) revelation, - and Allah knoweth best what He revealeth - they say: Lo! thou art but inventing. 16:101