One way to achieve this would be to clone () the wizard's element tree in its original state and save it in a global variable or in a data document:
$(document).data("initialWizard", $("#yourWizard").clone(true));
(Note that passing true to clone() also clones the item data and event handlers, which may be convenient in your case.)
Then, when you want to restore the master to its original state, you can do:
$(document).data("initialWizard").replaceAll("#yourWizard");
source share