I've been desoldering the switches on a mechanical keyboard. One of the keys however no longer works. The key doesn't register.
I think I've broken the eyelet for one of the connectors with a bad desoldering job and essentially just pulled it out.
If that "eyelet" is connected to the copper pour that surrounds it, it is an easy repair. Repair rivets are made for that purpose, but minimal quantity is probably 100. Look for PCB repair rivets. If it connects to a thinner PCB trace, the repair is done the same way as described below, but is a little more difficult.
For a one-off, I would remove a small area of the solder resist on one or both sides (only you can tell whether that is needed), place a small wire in the hole and solder to the cleaned area(s), finally, insert the switch and solder it to the wire. You only need to remove enough of the resist to solder the wire.
A small fiberglass "scratch brush" works great for removing solder resist, but scraping carefully with a small blade (e.g., #11) also works well.