The yellow stuff is bile. That in and of itself is not necessarily bad; it usually doesn't back up into your stomach, however. When it does, it makes you nauseous; might make you puke (as you did). Bile tastes really bitter, in case you remember that. The stomach doesn't like it, and tries to get rid of it as quickly as possible, which is generally regurgitation.
For bile to leak back up into your stomach (it's usually released into the small intestinal area, just past the stomach), means that something went awry in the normal sequence of digestion, e.g., rancid meat or fats in food products, contaminated food (food poisoning), and undoubtedly exasperated by excess alcohol still in the stomach. The stomach might try to get that stuff passed on quicker than it ordinarily would, hence the exit to duodenum might be "looser" than ideal, therefor the back up of the bile. Bile secretion is stimulated by high fat, protein, and/or acidic elements in the stomach. It is a normal and essential part of your digestive system, just not in your stomach.
The best thing to eat when you have drunk too much alcohol is complex carbohydrates, e.g. bread, rice, etc. These don't stimulate bile production (at least not as much), soak up the excess alcohol, and are fairly innocuous passing through your system. Drinking lots of water helps too.