Preheat the oven to 425°F.
In an ovenproof nonstick 10-inch skillet, melt 1 teaspoon of the butter over low heat. Add the garlic, cover, and cook gently until the garlic is translucent, about 3 minutes. Remove the pan from the heat and set aside to cool. Discard the garlic.
Put the potatoes in a medium bowl and beat in the nutmeg, flour, and salt and pepper to taste.
Sprinkle 3 tablespoons of the cheese into the skillet. Gently spoon the potato mixture into the pan, taking care not to dislodge the cheese, and press down with the back of a spoon to form a flat cake. Sprinkle the top of the cake evenly with the remaining 3 tablespoons cheese and a few grinds of pepper. Dot with the remaining 1 teaspoon butter.
Place the pan over moderate heat for a couple of minutes, until the skillet is very hot and you can hear the cake sizzle. Transfer the pan to the oven and bake for about 30 minutes, until the top is golden.
Slide a blunt knife carefully between the potato cake and the sides of the pan and lift the cake slightly to see if the bottom is brown and crisp. If not, place the skillet on a burner over moderate heat and cook for 2 to 3 minutes. Serve the cake directly from the pan, or turn it out onto a platter: Place a plate over the pan and, holding the two together, invert them so that the cake falls out onto the plate.
Up to 4 hours ahead, press the mashed potatoes into the prepared skillet, top with the cheese, and dot with butter. Cover and refrigerate until ready to bake. Bake for about 40 minutes, until the top is golden.