One of my current projects is to give students of fiqh a taste of the evidence behind rulings and legal reasoning, as well as a few hints as to why one opinion is preferred over others.
Several legal maxims concern harms and their removal. The main maxim is “Do not harm, and do not reciprocate harm.” This maxim comes from a hadith narrated by Ibn Majah which has the same wording. One of its sub-maxims is “Harms are removed.” A specific case that falls within these maxims is that buyers can return an item if it is determined that the item had an unknown defect. In this case it is possible to return things to the way they were before the sale without initiating a new harm. But sometimes things are not so straightforward.