[Git] Switch back to the previously checked-out branch

Created on November 30, 2026

Run git switch - to return to your preceding checkout. If you just moved from main to feature, the command switches back to main.

git switch -
Switched to branch 'main'

In this example, running the command again switches back to feature.

Git