To answer just the title of the question:
pushd someDirectory
do-something-in-this-directory
popd
you-are-at-the-previous-directory
Just in case: if you simple needed to go to a parent directory, use
cd ..
Please see:
http://en.wikipedia.org/wiki/Pushd_and_popd[
^].
Sorry, I'm too lazy to read and understand the whole question written by so lazy person. To me, it's enough to see that you did not explain what exactly do you mean by "step back". Just learning
cd
,
pushd
,
popd
and syntax of directory names will be enough to solve any similar "problem".
—SA