The directory stack permits to navigate and come back in the directory tree.
Directories are added to the list with the pushd command;
See pushd
The popd command removes entries from the list.
# we are now in /
pushd /aDir/
# we are now in /aDir/
popd
# we are now back in the starting current directory /