At least here in Washington, and I imagine in any state, you can stop a divorce action before the divorce has been finalized if both parties agree to the dismissal.
A dismissal ends the case so that the divorce does not move forward. Also, if the other party has responded to the Petition for Dissolution, the party who filed can dismiss on their own.
To dismiss the case, you need to have the court sign an order of dismissal. This means you will need to file a motion asking the court to dismiss, and have an order of dismissal ready for the court to sign. If the other party has filed a Response to the Petition, then you will need to have them sign both the motion and proposed order, showing that they are in agreement.
The reason the other party needs to sign off on the dismissal is that as a general rule their Response to Petition includes a request for something from the court as well, such as granting the divorce, dividing property, etc. This request is what we call a counterclaim.
At this point both sides have asked for something, which means the court cannot dismiss based on one side’s motion without also dismissing the claim/counterclaim of the other party. Under the civil rules, in this situation the court cannot dismiss without the consent of both sides.
It should also be noted that the Respondent (the person who did NOT file the original divorce action) cannot bring a motion for dismissal without the agreement of the Petitioner, although I believe there would be an exception made in an unusual case such as where the Petitioner has died. In a case like that the divorce cannot go forward as there are no longer two parties.