There are two exceptions where a court does not have to follow a precedent. These are distinguishing and overrulling.
What is distinguishing?
Means that the judge finds the facts in the current case are different enough from the earlier one, to allow them to reach a different conclusion, and therefore not follow the precedent set.
What is overruling?
Where a court higher up in the hierarchy rules that a decision in an earlier case was wrong and overturns it e.g. Th Supreme Court can overrule all the courts below it in the hierarchy.
Explain R v R as an example.
A man attempts to rape his wife and justifies it using a centuries old precedent which said that a husband could not be guilty of raping his wife because a marriage contract gave the wife's irreversible consent. The Court of Appeal overruled this due to the fact that the idea of irreversible consent was unacceptable today because couples are now seen as equal partners.