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