This article introduces a command you can use when you want to return to the directory you were in before cd in the Linux Bash command line.
cd -
It’s simple.
If you do cd - again, it doesn’t go to the directory before that… instead, it returns to the directory you cd -‘d to.
Reference