You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You probably already know that cd - in Bash or Zsh changes the directory to its previous location (where it was before).
Git offers a feature in the same vein that is git checkout - that jumps to the branch you were on previously.
Say for instance you first are on the master branch then jump on the develop branch.
Finally you can use git checkout - to go back to the master branch.
# ~~~ Jump on the master branch
git checkout master
# ~~~ Jump on the develop branch
git checkout develop
# ~~~ Go back to the previous branch (we were on before, ie. master in this example)
git checkout -
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
You probably already know that
cd -
in Bash or Zsh changes the directory to its previous location (where it was before).Git offers a feature in the same vein that is
git checkout -
that jumps to the branch you were on previously.Say for instance you first are on the
master
branch then jump on thedevelop
branch.Finally you can use
git checkout -
to go back to themaster
branch.Beta Was this translation helpful? Give feedback.
All reactions