Grate cheese. Wash the thyme, shake dry and chop the leaves of 4 stems coarsely. Peel and wash the potatoes and cut them into thin slices (about 4 mm). Season slices in a bowl with salt, pepper and nutmeg
Halve the clove of garlic and rub the inside of a box mould (length 20 cm, 1 l capacity) with it. Grease the mould. Line the bottom and the edge of the mould with slices of ham, slightly overlapping, and let the ends hang over the edge. Put a layer of potato slices in the form, sprinkle with some cheese and thyme. Layer the remaining potatoes, cheese and thyme in the same way, finish with a layer of potatoes
Fold the ham ends over the potatoes. Wrap the mould in foil and bake in a preheated oven (electric cooker: 175 °C/ convection oven: 150 °C/ gas: see manufacturer) for approx. 1 1/2 hours. Remove the mould from the oven, remove aluminium foil and pour off the cooking liquid. Leave to rest in the mould for approx. 20 minutes, then turn over. Cut the cake into slices and garnish with the remaining thyme