    upstream_hash = run(["git", "rev-parse", "@{u}"], OVERLAY_MERGED).rstrip()
    new_version = cur_hash != upstream_hash
    git_fetch_result = check_git_fetch_result(git_fetch_output)
  
    cloudlog.info(f"comparing {cur_hash} to {upstream_hash}")
    if new_version or git_fetch_result:
      cloudlog.info("Running update")
  
 
</s> remove   new_version: bool = cur_hash != upstream_hash
 </s> add   new_version = cur_hash != upstream_hash </s> remove       r = [
        run(["git", "reset", "--hard", "@{u}"], OVERLAY_MERGED, low_priority=True),
        run(["git", "clean", "-xdf"], OVERLAY_MERGED, low_priority=True ),
        run(["git", "submodule", "init"], OVERLAY_MERGED, low_priority=True),
        run(["git", "submodule", "update"], OVERLAY_MERGED, low_priority=True),
 </s> add       cmds = [
        ["git", "reset", "--hard", "@{u}"],
        ["git", "clean", "-xdf"],
        ["git", "submodule", "init"],
        ["git", "submodule", "update"], </s> remove 
 </s> add   connect(uiState(), &UIState::offroadTransition, updateBtn, &QPushButton::setEnabled);

  branchSwitcherBtn = new ButtonControl(tr("Switch Branch"), tr("ENTER"));
  connect(branchSwitcherBtn, &ButtonControl::clicked, [=]() {
    QString branch = InputDialog::getText(tr("Enter name of new branch"), this);
    if (branch.isEmpty()) {
      params.remove("SwitchToBranch");
    } else {
      params.put("SwitchToBranch", branch.toStdString());
    }
    std::system("pkill -1 -f selfdrive.updated");
  });
  connect(uiState(), &UIState::offroadTransition, branchSwitcherBtn, &QPushButton::setEnabled);
  new_branch = Params().get("SwitchToBranch", encoding='utf8')
  if new_branch is not None:
    new_version = True

    upstream_hash = run(["git", "rev-parse", "@{u}"], OVERLAY_MERGED).rstrip()
    new_version = cur_hash != upstream_hash
    git_fetch_result = check_git_fetch_result(git_fetch_output)
  
  new_branch = Params().get("SwitchToBranch", encoding='utf8')
  if new_branch is not None:
    new_version = True

    cloudlog.info(f"comparing {cur_hash} to {upstream_hash}")
    if new_version or git_fetch_result:
      cloudlog.info("Running update")
  
keep keep keep add keep keep keep keep
 updated: add branch switching (#25200)

* switch param

* add to ui

* fix that

* fetch for new branch

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/updated.py