Preheat the oven to 375°F (190°C).
In a saucepan, heat the heavy cream, garlic, salt, and pepper over medium heat until it starts to simmer. Remove from heat.
Layer half of the sweet potatoes in a greased baking dish. Pour half of the cream mixture over the potatoes and sprinkle with half of the cheese.
Repeat the layers with remaining sweet potatoes, cream mixture, and cheese.
Cover with aluminum foil and bake in the preheated oven for 40 minutes.
Remove the foil and bake for an additional 20 minutes, or until the top is golden brown and the potatoes are tender.
Allow to cool slightly before serving.