I really appreciate the feedback everyone! I was tinkering with it before reading these responses, and I ended up logging into postgresql and found that my database had been saved from the day before. I was able to simply ctrl - enter through every tutorial step until I reached where I left off.
I’m defintely planning on using a local text editor to type out the code before pasting into terminal when ready.
Thanks again everyone!