Disobedience of or resistance to a temporary restraining order or preliminary or final injunction is punishable as a contempt of court. The court may cause to be undone or destroyed whatever may be done in violation of an injunction, and the person aggrieved thereby may recover the damages sustained as a result of the violation.