Preheat your oven to 375°F (190°C).
In a saucepan, melt the butter over medium heat. Add the minced garlic and cook until fragrant, about 1-2 minutes.
Add the heavy cream to the saucepan and stir in the chopped rosemary. Season with salt and pepper to taste. Let the sauce simmer gently for 5-7 minutes, allowing the flavors to meld together. Remove from heat and set aside.
In a large oven-safe dish, layer the thinly sliced potatoes evenly on the bottom.
Place the cod fillets on top of the potatoes and season them with salt and pepper.
Pour the rosemary cream sauce over the cod and potatoes, making sure everything is evenly coated.
Drizzle a little olive oil over the top and cover the dish with aluminum foil.
Bake in the preheated oven for 25-30 minutes, or until the cod is cooked through and the potatoes are tender.
Remove the foil and broil for an additional 3-5 minutes to brown the top slightly.
Serve hot, garnished with fresh rosemary sprigs if desired.