How to reset all vars without destroy script?

My game has 2 scenes.

And there are scripts attached to object which has DontDestroyOnLoad.

So this script’s various vars occur un-expected changes and errors.

Is there a neat way to reset all the variables to initial setting? (private vars, vars, static vars)

Thanks.

To reset instance members to their default values you could remove the component and add it back again. Static members would have to have their initial value stored somewhere.