Therefore, if you add broccoli sprouts to your diet to relieve gastritis or an ulcer, you may have to keep eating them on a regular basis to maintain the benefit. Yogurt. Some yogurts contain active cultures that can help regulate the balance of good and bad bacteria in your gut and thus crowd out H. pylori.