Get the notebook back to the correct state.