Heat the milk, cream and garlic in a small pan until it's almost at boiling (don't boil though). Turn off the heat.
Take an oven-proof dish approx. 20cmx25cm, layer a third of the potatoes and onion on the bottom of the dish, overlapping slightly. Sprinkle on a quarter of the bacon, quarter of the cheese and a pinch each of the salt, pepper and thyme. Pour over quarter of the hot cream.
Repeat with another layer of everything, this time including half of the butternut squash.
Repeat with a final layer of the potatoes, onion and butternut squash, but this time, don’t sprinkle on the bacon (it will overcook if sprinkled on top at this point). Pour the remaining cream around the sides of the squash/potatoes (the cream should have filled up the dish and be just about touching the bottom of your top layer of squash). Sprinkle the rest of the cheese, thyme and a pinch of salt and pepper over the top.
Place in the oven and cook for 1 hour until the potatoes are tender and the top is browned. Sprinkle on the remaining bacon for the last 5 minutes of cooking to heat through.