Yes. Contempt of court is a tool for a judge to force compliance with the judge's wish. Generally once you do what the judge wants, the contempt charge will be dismissed.
Incidentally, in many states Contempt of Court is the only crime with no maximum penalty. You can spend the rest of your life in jail one day at a time.