What stops blood from flowing backwards through the heart ?
Valves.
A set of valves exist between each atrium and ventricle, preventing blood from flowing backwards into the atria. Another set of valves exist between the ventricle and arteries, preventing blood flow back into the ventricles. Veins also have some one-way valves that stop blood from flowing backwards between each heartbeat.