Switching between branches

You can view and make commits to any of your repository's branches.

In this article

Switching between branches

If you have uncommitted, saved changes, you'll need to decide what to do with your changes before you can switch branches. You can commit your changes on the current branch, stash your changes on the current branch, or bring the changes to your new branch. If you want to commit your changes on the current branch, follow the steps in "Committing and reviewing changes to your project" before switching branches.

  1. At the top of the app, click Current Branch.

    Current Branch drop-down menu

  2. In the list of branches, click the branch you want to switch to.

    List of branches in the repository

  3. If you have saved, uncommitted changes, choose Leave my changes or Bring my changes, then click Switch Branch.

    Switch branch with changes options

Retrieving stashed changes

To access changes you've stashed in another branch, switch back to the branch you stashed the changes in.

  1. At the top of the app, click Current Branch.

    Current Branch drop-down menu

  2. In the list of branches, click the branch you want to switch to.

    List of branches in the repository

  3. In the left sidebar, click Stashed Changes.

    Stashed changes option

  4. Click View stash.

    View stash button

  5. To delete your stashed changes, click Discard, or to use your stashed changes, click Restore.

    Discard or Restore stashed changes

Ask a human

Can't find what you're looking for?

Contact us