Melt margarine in a 2- to 3-quart pan over medium heat.
Add onion and minced thyme; cook, stirring often, until onion is soft but not browned (3 to 5 minutes).
Stir in garlic, then add broth.
Increase heat to high and bring mixture to a boil; boil until reduced to 1 1/2 cups (about 3 minutes).
Peel and shred potatoes.
Add to onion mixture; reduce heat to medium-low and cook, uncovered, stirring often, until potatoes are tender to bite (about 25 minutes).
Remove from heat and mix in milk and cheese.
Season to taste with nutmeg.
Spoon into a warm serving bowl; garnish with thyme sprigs, if desired.