Sadly, I only learned about this last year by stumbling upon it randomly on the internet. I use it so infrequently that I always forget what it is by the time I need it again.
How do you change to your previous directory?
The shortcut is
If you want to use this in your prompt, you have to refer to it with
See the example:
You might also want to look at