A stomach virus may seem scary when you’re pregnant, but if you can keep liquids down, rest and ride it out at home for 12 to 24 hours, suggests Dean. “Staying hydrated when you have a stomach bug is key,” he adds. Replace any fluid you lose if you’re throwing up, have diarrhea, or are feverish and sweating. Drink an oral rehydration solution (such as Pedialyte or Gastrolyte), juice, or water in small, frequent amounts. If your symptoms don’t get better, call your provider, Dean advises, as there can be other more serious causes for stomach pain.