If the shifter lever breaks, you should still have the capacity to change gears, but just nothing to change them with. Most shifters require quite a push to get them to change gear, and without the proper length lever this can be a problem.
Old, top-mounted index shifters often have a ‘friction’ mode. Switch to this mode, then use a tool, stick, or rock to push the shifter stub into the position for a sensible gear.
For newer shifters, it may be possible to lash an Allen wrench to the stub, or drill/melt a hole through the stub to push an Allen wrench or screwdriver through. The intention is to provide a long enough handle that you can get the leverage needed to change gears.
If you are absolutely stuck in the wrong gear, follow directions for a broken gear cable.
Tip: If you have a remote shock lockout, it may be possible to repurpose this to become a friction shifter. Back in the day, all bikes’ shifting relied on friction. You pulled the shift lever until the gear changed, then a little bit more until the annoying click-click-click stopped, and the shift lever stayed put because of the friction between the plates within it. Your derailleur could be way out of adjustment and you could still shift just fine.