The study was published in the Journal of Antimicrobial Chemotherapy and says that eating a bunch of garlic after contracting food poisoning probably won't do much good, but if your body is stocked up on diallyl sulphide beforehand, you'll have an easier time dealing with a food-induced bout of sickness.
The most common bacterial strain of food poisoning -- campylobacter -- affects about 2.4 million Americans every year, according to the Centers for Disease Control. The bacteria is covered in a slimy film, which diallyl sulfide is able to easily penetrate and kill.
Garlic's diallyl sulfide compound, among other things, causes that hard-to-get-rid-of odor when working with the raw root, but also sanitizes surfaces for food and stops bacteria from spreading.
"Diallyl sulfide could make many foods safer to eat," Barbara Rasco, study co-author and professor of food science at Washington State University, said in a statement. "It can be used to clean food-preparation surfaces and as a preservative in packaged foods like potato and pasta salads, coleslaw and deli meats. This would not only extend shelf life but it would also reduce the growth of potentially bad bacteria."