My daughter has similar issue when she was young. I don't know how to prevent it, because non of my friends nor doctors gave anything really works. It just went better when she grew up. Better doesn't mean no issue, she is still very easy to throw out even now, she is almost 4 years old. It seems whenever she eats too much, she will throw out everything. So I can't never force her eat a lot. For small baby, maybe you can try to reduce each meal amount, but increase the feeding times.
Good luck!