The Rambam (Rav Moshe Maimonides, Spain-Egypt, 1135-1204), in Hilchot Mamrim, writes that Bateh Din (rabbinic courts) of every generation have the authority to issue edicts which they feel are necessary for their communities. However, the Rambam adds, before issuing an edict, the Rabbis must carefully assess whether or not the people are capable of abiding by such a rule. If they issue an edict which the majority of people found too difficult to uphold, such that it was not followed by the majority of the community, then the Takana (edict) is automatically void. Since it was never accepted, it is not binding at all.
If an edict was accepted, and followed by the majority of the community, then it is binding even upon future generations. If, in a later generation, the Rabbis see that the reason for this edict is no longer relevant, or that it has fallen into widespread neglect, they have the power to annul the edict. Even if this Bet Din is of a lesser stature than the original group of Rabbis that instituted the edict, nevertheless, they have the power to revoke the edict.
An example of an edict which never became binding because the people found it too difficult is the Gemara’s fascinating account of the Sages’ decree after the destruction of the Bet Ha’mikdash forbidding the consumption of meat and wine. They felt that if Hashem cannot have the meat of sacrifices or the wine libations on His "table" in the Bet Ha’mikdash, then we should not enjoy meat or wine, either. However, the people were unable to adhere to such an edict, and so it never became binding.
Another example is a responsum in Kol Mebaser, by Rav Meshulam Roth (1875-1962), addressing the proposal that was put forth after the Holocaust to forbid going to Germany. Rav Roth wrote that such an edict would not likely be accepted, as some Jews needed to return to Germany to claim their property, and others still had family members living there. He therefore felt that such an edict should not be issued.
This question brings to mind a tradition that existed among some descendants of Jewish exiles from Spain that an edict was made after the expulsion in 1492 forbidding returning to Spain. After what Spain did to its Jewish population – expelling those who refused to convert to Christianity – it was decided that no Jew should ever go to Spain. This edict is not written in any book, but some Sephardic Jews had such a tradition. (In fact, some say that the famous Toledano family is so named because they decided they would never return to Toledo, and they thus called themselves "Toledano," which means, "Toledo, no.") Interestingly, in 5738 (1978), Hacham Ovadia Yosef was invited to participate in the inauguration of a yeshiva in Madrid, and he thus needed to address the question of whether it was permissible to travel to Spain. He wrote a responsum on the subject that was later published in his Yabia Omer (vol. 7), in which he asserts that this is permissible. Although generally we follow the rule of "Safek Herem Le’humra" – we act stringently when an uncertainty arises regarding a Herem (a ban associated with a curse), Hacham Ovadia felt that this applies only when it is certain that the edict was issued, and there is a question regarding its scope. In this case, however, there is no clear source proving that such an edict was in fact issued. And, even if there was such an edict, it was perhaps directed only to the descendants of particular families, and it may have referred only to settling in Spain, and not to visiting. Due to these uncertainties, Hacham Ovadia felt it was permissible to visit Spain.
An example of an edict which was, in fact, issued, and which was subsequently annulled, is one which Hacham Ovadia found in a certain book, forbidding single men aged 20 and above from living in Jerusalem. The Shulhan Aruch (Eben Ha’ezer, 1), based on the Gemara, writes that a boy should ideally get married already at the age of 13, and if not, then at 18, but certainly no later than age 20. (Of course, if there is a valid reason for the boy to delay marriage, such as nowadays, when young men still need to learn Torah and a trade at that age, it is permissible.) Hacham Ovadia found a document from the 18th century announcing an edict that any unmarried young man who is 20 years or older may not reside in Jerusalem, and that the authorities were allowed to evict him. The declaration was signed by some of the leading Torah luminaries of that time, including Rav Gedalya Hayoun (d. 1751), Rosh Yeshivat Bet-El, and Rav Rafael Azulai (father of the Hida).
Upon discovering this edict, Hacham Ovadia was very concerned about the fact that this rule was, quite obviously, not being followed. A Herem is treated very seriously, and the Kabbalists warn that violators are cursed in all 248 limbs (the numerical value of the word "Herem"). (There were certain periods when the Kabbalists sensed that the powers of strict judgment were in force, and they would then try to annul every edict in order to ensure that nobody would be in violation of them and thus be exposed to danger.) Unless the edict was banned, Hacham Ovadia feared, single men in Jerusalem could, Heaven forbid, be subject to this curse. Hacham Ovadia promptly joined with Hacham Yehuda Sadka (1910-1991) and Hacham Bension Abba Shaul (1924-1998), and they formed a Bet Din and annulled this edict.
Finally, in the early years of the modern-day return to the Land of Israel, an edict was issued forbidding new Jewish immigrants from settling the city of Yaffo (Jaffa). This was done in order to encourage the settlement of other, less populous, regions. With time, of course, such a policy was no longer needed, and so the Rabbis of Jerusalem assembled a Bet Din and formally annulled the edict.
All these examples demonstrate the rules established by the Rambam – that an edict which was never accepted is not binding to begin with, and one which was accepted remains binding until a later Bet Din proclaims its annulment.