Been there. Thought I was in a subordinate directory, forgot I was in /dev. When my tty went funky, I realized the scope of my error, hit ctrl-C, and with great luck managed to remember the mknod incantation for tty.
With the tty restored, the rest was painful but doable.