DEV Community

[Comment from a deleted post]
Collapse
 
stealthmusic profile image
Jan Wedel • Edited

Using pushd and popd could be helpful especially when you do some more cds or in scripts.
If you simply want to switch between the current and the last directory, you could simply use cd -.

Collapse
 
aerosoul profile image
Daniel Liuzzi

You can do this in Git as well; git checkout - switches back to the previous branch.