@Override
    public void restoreState(@NotNull ChangesTree tree, MyState state, boolean scrollToSelection) {
      if (state != null && !state.selectedChanges.isEmpty()) {
        tree.setSelectedChanges(DvcsBranchUtil.swapRevisions(state.selectedChanges));
      }
      else {
        tree.resetTreeState();
      }
    }
@Override
    public void restoreState(@NotNull ChangesTree tree, MyState state, boolean scrollToSelection)