Preheat the oven to 375 degrees and lightly grease a medium baking dish.
In a saucepan over medium heat, melt the butter. Stir in the flour and cook for one minute to form a roux.
Gradually whisk in the milk until the mixture thickens. Add the minced garlic, thyme, salt, and pepper, then stir in 1 cup of the cheddar cheese until melted.
Arrange half the potato slices in the baking dish. Pour half the cheese sauce over them. Repeat with the remaining potatoes and sauce.
Sprinkle the remaining 1/2 cup cheddar cheese on top. Cover with foil and bake for 30 minutes.
Remove the foil and bake for another 20 minutes until the potatoes are tender and the top is golden.