Preheat your oven to 400°F.
Slice the tops off the garlic heads to expose the cloves.
Place the garlic heads on a piece of aluminum foil. Drizzle with olive oil and sprinkle with salt, pepper, and thyme if using.
Wrap the garlic heads tightly in the foil.
Place the wrapped garlic on a baking sheet and roast in the preheated oven for 30-35 minutes, or until the cloves are soft and golden brown.
Remove from the oven and let cool slightly before unwrapping.
Squeeze the roasted garlic cloves out of their skins into a bowl. Add balsamic vinegar if desired and mix well.