Preheat the oven to 325 degrees F (165 degrees C). Spray an 8×8-inch baking dish with nonstick cooking spray. Set aside.
Combine potatoes, cheese, bacon, onion, mayonnaise, garlic, salt, and pepper in a large bowl. Transfer to the prepared dish.
Bake until potatoes are fork tender, about 1 1/2 hours. Top with green onions.