How can we know which hadiths were abrogated and which abrogated others? Isn’t this a source of confusion?
Question

I have a question regarding abrogations in Islam during the time of prophet Muhammad(PBUH). My question is that how can we be sure that the sahih ahadith we have today were not abrogated afterwards(i.e., sometime after that but before the demise of prophet Muhammad) and there was a new ruling on the matter?...there are many matters in which there were abrogations, matters that we know of so I am thinking that may be there were matters that were abrogated and that which we dont know of?...so how can we follow the sahih and hassan ahadith without knowing for sure that they were not abrogated later in time?
Praise be to Allah.What is meant by abrogation is when the Lawgiver cancelled out a previous, earlier ruling by means of another ruling that also comes from the Lawgiver, but it came later than the first ruling. 
Abrogation may be known in several ways: 
1. when the Lawgiver stated that something was abrogated
2. when the Sahaabi stated something to that effect
3. when the ummah is unanimously agreed that a hadith is abrogated
4. when two hadiths contradict one another, and it is not possible to reconcile between them in any way, and it is known which one came earlier and which came later; in that case the earlier hadith is abrogated.
An-Nawawi (may Allah have mercy on him) said: With regard to abrogation, it is when the Lawgiver cancelled out an earlier ruling by means of a later ruling. 
This is the favoured view concerning the definition of abrogation… 
Abrogation may be known from several things, including the following: 
· A clear statement to that effect from the Messenger of Allah (blessings and peace of Allah be upon him), such as when he said: “I used to forbid you to visit graves, but now visit them.” Narrated by Muslim (977).
· The words of the Sahaabi, such as: The last of the two commands was not to do wudoo’ after eating anything that had been touched by fire.
· That which is known from chronological order.
· That which is known from consensus, such as executing the drinker of alcohol after a fourth offence. This is abrogated, and the fact of its abrogation is known from consensus.
Consensus in and of itself does not abrogate and is not subject to abrogation, but it is indicative of the presence of something that abrogates a ruling. And Allah knows best. 
But if two hadiths appear to contradict one another, then it is essential to reconcile between them or to determine which of them outweighs the other. 
But that is usually undertaken by leading scholars who combine knowledge of hadith and fiqh, or scholars of usool who are prominent in that field, who are well-versed in subtle meanings. One who meets this description will not have a problem with such matters except rarely, in some cases. 
Moreover such cases of contradiction are of two types, the first of which is where it is possible to reconcile between them, in which case that is what must be done, and it is obligatory to accept and comply with both hadiths. 
Whenever it is possible to interpret the words of the Lawgiver in a manner that is of greater benefit, then that interpretation should be adopted. 
And we should not decide that one report abrogates the other when it is possible to reconcile between them, because abrogation means deeming one of the hadiths to be something that is not to be acted upon. 
An example of reconciling between reports is the reconciliation of the hadith “There is no ‘adwa (contagion)” and the hadith “No healthy person should be exposed to a sick person.” 
The way to reconcile between them is to note that diseases are not contagious by nature, but Allah, may He be glorified and exalted, has made exposure to them a cause of infection. The first hadith denies what the people of the Jaahiliyyah used to believe, that diseases were contagious by nature. The second hadith tells people to avoid that which usually cases harm upon exposure to it, and that harm could only happen by the will and decree of Allah. 
The second type is reports in which there is a contradiction in such a way that it is not possible to reconcile between them in any way. 
If we know that one of them abrogates the other, we should give it precedence. 
Otherwise, we should act upon the one that appears more likely to be sound. In order to know which is more likely to be sound, we need to know which one has been narrated by a greater number of narrators and their status, and other factors that could help us to determine which is more likely to be sound. There are approximately fifty factors, which were compiled by al-Haafiz Abu Bakr al-Haazimi at the beginning of his book an-Naasikh wa’l-Mansookh. I have compiled them in abbreviated form, but there is no need to mention them here for fear of making this discussion too lengthy. 
End quote from Sharh Muslim (1/60-61] 
Al-Haazimi (may Allah have mercy on him) said, discussing ways of working out which report abrogates and which is abrogated: 
That may be known from a number of indicators, including the following: 
· The words of the Prophet (blessings and peace of Allah be upon him) clearly indicate that, such as when he (blessings and peace of Allah be upon him) said: “I used to forbid you to visit graves, but now visit them.”
· Or the wording of the Sahaabi states that, such as the hadith of ‘Ali ibn Abi Taalib (may Allah be pleased with him): The Messenger of Allah (blessings and peace of Allah be upon him) used to instruct us to stand up for funerals, then he would remain seated after that, and he instructed us to remain seated.
· Where the date is known, such as the report of Ubayy ibn Ka‘b (may Allah be pleased with him) who said: I said: O Messenger of Allah, what if one of us has intercourse with his wife but does not ejaculate? The Prophet said: “Let him wash whatsoever part of his body touched the woman, then let him do wudoo’, then let him pray.”
This hadith indicates that no ghusl is required if one does not ejaculate, and that what makes ghusl obligatory is ejaculation. 
When we examine the isnaads of this hadith, some of the isnaads show us that this was at the beginning of Islam, and it remained in effect until some time after the hijrah. 
Then we find that az-Zuhri asked ‘Urwah about that, and ‘Urwah replied that ‘Aa’ishah (may Allah be pleased with her) had told him that the Messenger of Allah (blessings and peace of Allah be upon him) used to do that, and he did not do ghusl; that was before the conquest of Makkah, then after that he would do ghusl (in this situation) and he instructed the people to do ghusl too. 
· Where the ummah is unanimously agreed that something is abrogated. This is the strongest sign of abrogation.
If it is not possible to differentiate between them, because the date is unknown, and there is nothing in the wording of the report to indicate that, and it is not possible to reconcile between them, then in that case we should go through the process of finding out which one is more likely to be sound. 
The ways of doing so are many; I will mention most of them… 
End quote from al-I‘tibaar fi’n-Naasikh wa’l-Mansookh min al-Athaar (p. 8), by Abu Bakr Muhammad ibn Moosa ibn ‘Uthmaan al-Haazimi al-Hamdaani (d. 584 AH). His book is one of the most useful books on this topic. 
Thus it will be clear to you that the matter is not difficult. Most of the proven hadiths are not abrogated, and the issue of abrogation only arises in the case of hadiths that contradict one another when it is not possible to reconcile between them. In that case the Lawgiver may state that they are abrogated, or the Sahaabi may say something to that effect, or there may be consensus that the hadith concerning it is abrogated, or the fact that it is abrogated may be known from chronological order. 
The scholars of hadith and the commentators on the Sunnah have not omitted any such matter without explaining it, praise be to Allah. So there is no need to confusion and doubts. 
For more information, please see the answer to question no. 147416. 
And Allah knows best.