If you want to return to the previous directory on terminal just one simple command you only need do:
cd -n
ex:
Open termina, lock at the current folder and navigate to folder /usr/local. Now go back to previous directory
To do this you only need reproduce this steps:
open terminal and write:
1. pwd
(get the current directory path)
2. cd /usr/local
3. cd -
(go back to previous directory)