Garlic is good for your digestive tract and helps fight fungi and toxins while sugar feeds such things (including giardia) so likely the garlic did you some good regardless of what you may have had.