Peel the cooled jacket potatoes and grate with the hash browns. Finely chop the onion and clove of garlic.
Grate the cheese with the hash browns too. Mix everything together and season with salt, nutmeg and plenty of pepper. Finally, mix in the walnuts and flakes of butter.
Butter a gratin dish, pour in the mixture and bake in a preheated oven at 180 degrees for about 15-20 minutes.