If an Apple Bluetooth Magic Mouse/Trackpad/Keyboard normally paired to an iPad is paired to a device you no longer have access to, you can pair it back to the iPad like this:
- Plug the peripheral into a Mac
- Forget the peripheral from the Mac
- The peripheral will now be discoverable for the iPad