According to current codes, the backing material for a tiled wall in a bathroom should be fiber cement board, and that makes sense, because fiber cement board is a waterproof material with all the stability ceramic tiles need. Hardie board, Durock and CertainTeed are some leading brand names. Codes notwithstanding, some homeowners and even some builders may use water-resistant drywall. It's sometimes called green rock because older versions have green paper.
Drywall isn't quite as impact resistant as fiber cement board, but neither material damages easily, especially when covered with tiles. An impact strong enough to damage either backing material would definitely also damage the tiles, and that's good in a way. The tiles have to come off before you can fix the backer board, and they are easier to remove if already cracked and broken.
To do a Hardie board repair or fix drywall, you have to completely uncover the damaged section plus an extra perimeter that allows you to cut out a rectangle that includes the damaged part. It's best if the cutout overlaps at least two wall studs so you have something to which you can fasten the replacement material.
Demolition and Removal of Damaged Material
Getting damaged tiles off the wall is a matter of prying them with a stiff putty knife, but before you can remove tiles in good condition, you first have to break up the grout. Do this with a hammer and chisel, and then pry the tile as soon as you can get the putty knife underneath it without damaging the tile. Continue removing tiles until you've uncovered a rectangular area long and wide enough to allow you to cut out the damaged area. Scribe a rectangle on the backer board with a straightedge and pencil.
If the backer board is drywall, you can cut along the lines with a drywall saw. It's not a good idea to use a drywall saw to cut fiber cement board, though. The abrasive material quickly dulls the saw. The best way to cut it is with an angle grinder that has a diamond cutting wheel. You can also use a jigsaw or hacksaw fitted with a metal-cutting blade, but you'll probably have to throw out the blade when you're done.
Replacing Fiber Cement Board or Green Rock
If you worked carefully, you'll have a rectangular cut-out that is easy to measure. Transfer the measurement to a new sheet of the same material and cut it out by scoring with a knife or using a power saw. Place the rectangular section of new material in the hole in the wall and fasten it to the studs with the recommended fasteners. Use stainless steel drywall screws for green rock and star drive cement board screws for cement board.
Patching Cement Board and Green Rock
Don't worry if the edges between the new backer board and the existing material aren't clean and straight. Just fill large gaps with cement for patching holes. In the case of fiber cement board, it's best to use thinset mortar, but if you're replacing drywall, you can use powdered patching compound which hardens after you mix it with water. Let the patches harden before proceeding. If you have the time, it's best to wait overnight.
When the patches set, tape the joints around the replacement rectangle with fiberglass tape. Use setting-type joint compound (hot mud) to secure the tape to drywall and thinset mortar to hold it to fiber cement board. Scrape carefully. It's difficult to sand hot mud, and sanding thinset mortar is virtually impossible. When the mortar or mud sets, you're ready to re-tile.