Just a few words in response to Katrin Federle 's question, about how a later Sanhedrin could undo an enactment of Ezra (and his Sanhedrin).
The general rule is that a Sanhedrin cannot undo an enactment or decree of an earlier Sanhedrin, unless the later one is greater in wisdom and greater in "number" (age). However, an exception is made when an old enactment serves to weaken a law rather than strengthen it, due to changed circumstances. The ten enactments of Ezra had two mai n purposes.One was to encourage family life, in order to insure the growth of the tiny, beleaguered community. The other was to increase the respect for Torah among the people. In this context, we may understand his enactment that one may not study Torah when unclean. In the fourth century, at the time of the last Sanhedrin, it was seen that Jews were, under Byzantine persecution, fleeing to distant lands and out of the way places. Often, in these places, suitable immersion facilities were difficult to come by. If a man needed to immerse every day, he likely would rather cease studying. So the enactment designed to increase the honor of Torah, was now largely preventing its study. They therefore felt obligated to rescind the original decree. Similarly, many (but not all!) rabbis believe that if the changing circumstances are such that had they existed then, the decree woulod have never been made, we may consider it as null and void. An example is "gilui"; leaving beverages unattended and exposed. if you are having a cup of coffee, and you are called in to the next room, when you return, that coffee if forbidden to drink. Why? A snake or scorpion may have discharged its venom into the drink while you were not there. Already in the tenth century, rabbis reasoned that since we have decent windows, this is a highly unlikely scenario, and may be ignored. (Ancient homes in the Middle East, except for the very rich, had only holes cut out in the walls, which were plugged up at night with wooden stoppers. Snakes and scorpions would have been common place in homes at that time). Some, especially the Vilna Gaon, were adamant that even though it seems so far fetched to us, it is a ruling of a Sanhedrin, which cannot be undone. Therefore, some observe this even today.