If there's a stud behind the drywall, remove the anchor, patch the drywall, and then screw into the stud.
Since I tried pushing the drill deeper, did I damage the stud?
You didn't damage the stud, but if you drilled to any significant depth, it would be good to fill the hole. Use a flashlight to get a good look inside the hole after the anchor is out. You can also measure the depth by inserting a small screwdriver or coat hanger. If it is deep, force some wood filler, like Plastic Wood, tightly into the hole in the stud and let it dry before patching the drywall.
What do I patch the drywall with?
You can patch the drywall with any kind of spackle or patching compound. If it is a large, deep hole, do it in several steps because the material shrinks when it dries. Fill the hole and let it dry, which will probably leave the patch concave and maybe cracked. Then fill that again, applying a little excess. When that dries, sand it smooth.
The spackle will be mainly for appearance, and the wood filler doesn't have the holding power of wood. They will serve more as a guide for the screw because the distance between the stud material holding the screw and the wall surface can create some leverage on the screw. You will want to drill a clearance hole in the drywall and a pilot or clearance hole in the wood filler and pilot hole in the stud for the screw.
Also, that means the screw only has 1/2 inch to attach to the stud. Is that ok? Is that enough to hold the curtain rod bracket or do I need to get longer screws?
Screw length depends on how many screws will be holding the bracket and how heavy the rod and curtains will be (and whether children will be pulling on them). If there are many screws and they aren't supporting much weight, 1/2" of actual stud on one of them is probably fine.
But the better solution is to just use a longer screw (bring a sample to any hardware store, and they will have screws the same diameter & style but longer). 3/4" of actual stud will support a lot of weight, so look for a screw that's about 3/4" longer than the depth of the hole in the stud plus the thickness of the drywall.