Preheat oven to 350 degrees F (175 degrees C). Grease a 2 quart casserole dish.
Bring water to a boil in a large saucepan with garlic and salt. Stir in grits, reduce heat to low, and cook until thick, about 5 minutes, stirring frequently.
Remove from heat and stir in cheese and butter until melted. In a small bowl, whisk together egg and milk, then stir into grits.
Pour grits mixture into greased casserole dish.
Bake in preheated oven for 20 to 25 minutes, until firm.