How to use dirs, pushd and popd commands ?

$pushd upstream-kernel/
~/upstream-kernel ~
$pwd
/home/jeffrin/upstream-kernel
$cd ..
$pushd temp/
~/temp ~ ~
$dirs
~/temp ~ ~
$dirs -l
/home/jeffrin/temp /home/jeffrin /home/jeffrin
$pwd
/home/jeffrin/temp
$pushd ../upstream-kernel/
~/upstream-kernel ~/temp ~ ~
$dirs -l
/home/jeffrin/upstream-kernel /home/jeffrin/temp /home/jeffrin /home/jeffrin
$pushd ../testing/
~/testing ~/upstream-kernel ~/temp ~ ~
$dirs -l
/home/jeffrin/testing /home/jeffrin/upstream-kernel /home/jeffrin/temp /home/jeffrin /home/jeffrin
$popd 
~/upstream-kernel ~/temp ~ ~
$dirs -l
/home/jeffrin/upstream-kernel /home/jeffrin/temp /home/jeffrin /home/jeffrin
$popd 
~/temp ~ ~
$dirs -l
/home/jeffrin/temp /home/jeffrin /home/jeffrin
$