You know where you started.
When you started, did you know where you wanted to end?
If you knew where you wanted to end, it should be pretty easy to figure out when things got off-track. Keep the writing that went off in the wrong direction; just put it at the end of your file, two or three pages down where you can't see it. Then, after you've started writing in the new direction, it will be easier to get rid of that part when you've got something better to replace it with.
If you had your idea, and just started writing, and you didn't really know where you were heading... stop and figure out where you were heading. The ideas are the easy part, but stringing ideas into a compelling series of events that hang together for a purpose is much harder. And when we work with a short story format, we have a whole lot less leeway to write by the seat of our pants-- everything needs to fight tightly together in a compact space. (We've all read novels where we think, "Ugh, this writer was trying to pad their wordcount!")
So, you've got your start. What are you obstacles? What are you motivations? What are your character's penalties for failure? What observations do you want to make? Does your character need to grow, or just act? What problems need to be solved? What are those random scenes that you've been wanting to write for years-- are any of them components of this story?
Figure out the logical bones. A --> B --> C --> D --> E. Then you can start padding out the narration and the dialogue and the character development and the world building, or whatever elements apply to your genre/story. After you've written it through, you can check your wordcount. If you were targeting something like 10k words, and your story only clocks in at 5k, you can look at it and see what needs to be developed. Is the story too compact, and there's room for an additional obstacle? Is something unfulfilling? Is something unclear? etc.
The nice thing about short stories is that they're usually small enough to fit in our heads, and because they're so short, they're usually easy enough to write in a short space of time before we forget what we were doing when we started something. (vs, say, the time necessary for a 100k-word novel.) But it's still important to have an idea of the thing as a whole, because otherwise, all you have is a vignette instead of a story.