Preheat oven to 400°F Butter a 1 quart casserole dish. In sauce pan, sauté onion and garlic in butter over med heat until tender. Stir in cream cheese cubes and undiluted soup; cook, stirring constantly, until smooth and hot. In casserole, alternate layers of frozen potatoes and cream cheese sauce, ending with sauce layer. Cover and bake 45 minutes or until sauce is bubbly and potatoes are tender. Remove from oven and sprinkle with shredded cheese.