gonna ask all my random questions in here

so i'm learning minecraft, and now im playing with redstone. I made a railroad through my mines, but how do you make a cart that automatically stops, but can go back without making a seperate return track? If I forget to hit the switch I made on the power rail it just jets me back to where i came from!