Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Last active October 1, 2020 06:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ahmadawais/01b960db524bc45499aa64110791e9b3 to your computer and use it in GitHub Desktop.
Save ahmadawais/01b960db524bc45499aa64110791e9b3 to your computer and use it in GitHub Desktop.
[OneDevMinute]: Go To Previous Git Branch Or Previous Directory via Terminal
title category date
Go To Previous Git Branch Or Previous Directory via Terminal
Git
2018-09-28

OneDevMinute

Another #OneDevMinute where you'll learn about how easy it is to access the previous git branch, and then again do the same with normal directories in your terminal.

git checkout other-branch
git checkout yet-another-branch
git checkout - # Takes you back in the other-branch
git checkout - # Takes you back in the yet-other-branch

cd dir1
cd dir2
cd - # Takes you back in the dir1
cd - # Takes you back in the dir2

P.S. If you like my work, feel free to share it, like it, and subscribe. Peace! ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment