Preheat oven to 400 degrees F (200 degrees C). Butter an 8x8-inch baking dish.
Fit a food processor with shredding disk and use it to shred cheese. Transfer to a small bowl. Fit processor with slicing disk and use it to slice potatoes.
Put potatoes in a large saucepan with half-and-half, garlic, salt, and nutmeg; stir gently to combine. Bring to a boil over medium-high heat, stirring occasionally. Cook at a gentle boil, stirring often with a heat-safe spatula to prevent sticking, until half-and-half has reduced and thickly coats potatoes, about 8 minutes.
Spoon into prepared baking dish. Smooth top and sprinkle evenly with cheese.
Bake in preheated oven until potatoes are tender when pierced with a knife and top is golden brown, 25 to 30 minutes. Let stand 5 to 10 minutes before serving.