You don't need to pull up the carpet. The shifter is a two piece stick shift. One piece is actually part of the transmission. The other piece "clips" into that piece. Your shift lever "pulled out" off of the shifter in your transmission. It slips right on. It is held in place by an internal clip that is located in the bottom of your shift lever. It also has a "rubber/plastic" bushing (I think they call it an "isolator") which wraps around that. What probably happened was that bushing deteriorated and the clip became lose. At that point, the shift lever pulls right up. It is not an expensive repair, nor is it time consuming.
Now to get the jeep going immediately, hold onto the shift lever and angle it to its normal driving position. If you jiggle it around, you should feel it bumping against something inside the rubber boot mounted on your carpet. The item you keep hitting is the transmission shift lever. Your shifter lever snaps onto the top of that... just like a socket snaps onto an extension. Jiggle the shift lever until you feel it is sitting ontop of the transmission lever... it is a square "socket" so it is easy to line up correctly. Once lined up, press down... since it came off, it should go down easy. Now, once it is "snapped on" you should be able to shift fine. The only problem you are going to have is the rubber boot mounted on the floor may make the shift lever "lift up" again. If this happens, snap it back down. Once you get the hang of it, it goes on real easy.
Now to prevent the lever from coming up again, contact Quadratech and order the parts. You will need the clip and the rubber bushing for your transmission shift lever. I have the AX15 but the AX5 stuff is the same. The parts are around $6.00. It is not an expensive repair. Now remove the steel rim that surrounds the shift lever boot off of the carpet. (It is a two piece unit on my jeep...there is an upper and lower rim that bolts together THEN it bolts to the floor.) All you should have to do it to remove the upper rim which holds the top part of the rubber boot to the bottom part. One piece of the boot is to look pretty from inside the cab, the other piece is to keep gravel and stuff from going into your cab through the shift lever hole in the floor. Also you need to remove the shifter knob at the top of the shift lever. On my transmission, there is the knob which screws on and a lock nut underneath. The lock nut has to be loosened while unscrewing the shift knob.
Once the top rubber shift lever boot is removed, you should be able to see how the lever sits on top of the transmission shifter which is mounted to the top of the transmission. At this point, leave the top of the transmission alone and remove the shift lever from the rubber boot you have just removed. Look at the bottom of the shift lever. You will see a square hole with all kind of crumbly crud inside. That crud is your bushing which isolates the vibration coming through the drivetrain. The clip is inside of the hole also and generally comes out with a simple set of pliers and some gentle nudging. NOW THIS IS IMPORTANT! Be aware of the orientation of the clip in reference to how it goes back in to the shift lever.
Now at this point, clean up the shift lever hole. Once cleaned, the bushing goes in and then the clip. Once these are in place, GENTLY see if the shift lever will go on the transmission lever. (The transmission lever may have to be cleaned up too. Just remember to vacuum up all of the pieces from the cleaning.) Now the shift lever should fit onto the transmission shifter snuggly. On my AX15, it was so tight that I had to remove the bottom rubber boot and rim, and the four bolts from the top of the transmission that held on the tranny shifter. I then put the tranny shifter in a bench vice, tightened the vice around the upper shaft (the part that the shift lever slips onto) and then try to push the shift lever on. I ended up using a hammer and a small piece of 2x4 to tap around the base of the shift lever to get it to snug. I didn't want to chuck up the shift lever and then hammer on the transmission shifter on top of it. Why? There is a small telflon bushing on the spherical shaped bottom of the tranny shifter. i didn't want to hammer on that at all... Also you don't want to hammer the shifter onto the tranny shifter from inside the cab, for the same reason... you will destroy that bushing and the assembly inside the top of the transmission.
The repair is pretty straight forward... just be careful how everything fits together. I hope this helps...