Detailed Instructions: Given scene/plot descriptions from movies or TV shows, and given a specific question about the scene, summarize the question into a title
Problem:I've never understood how Kirk, Spock, and Bones got back to the present at the end of “City on the Edge of Forever”. Going back to 1930 is simple enough, they stepped through the portal at the right moment, but there was no portal on their end! How did they get back?  Finding an answer is proving to be difficult because even after trying numerous search-term permutations, I only managed to find a single mention of the discrepancy.  I can understand if maybe they wanted to focus on the emotion and stuff of the episode, but it's a science-fiction show, and this was one of the first incidents of time-travel in the whole franchise, so getting back is a fairly big issue that can't just be glossed over.
Solution:
How did they get back in “City on the Edge of Forever”?