This camera has a very basic film winding mechanism.
My first guess. It could be that the button that you push to release the film in order to rewind the film got pushed while in the bag (releasing the the take-up spool) and this allowed the film in the canister, which is under tension, to pull the film backwards and the counter with it. I believe the counter is driven by the take up spool; when the spool turns, the counter turns.
My second guess. The basic winding mechanism is that the film is on held on the take-up spool by the the sprocket holes only instead of having a slot that the tip of the leader fits into. This means that the tension of the film wrapped around the spool keeps the sprocket nubs engaged with the sprocket holes in the film. I am guessing that if the camera was jostled around in a bag it may have caused the tension on the spool to loosen and that the spool could have turned there by causing the counter to turn.
There are two ways to proceed: you could just wind the film back into the canister and develop it OR take the camera into to a very dark room, absolutely black would be the best but very dark and cover the lens with black cloth, then fire the shutter and advance the film until you get from (count in you head, it's dark) 12 to 19 or 20. Then go back out into the light, make sure the counter has advanced and take a photo, wind the advance lever to ensure that the film is advancing the counter. If it is, you should be able to shoot the remainder of the film. If the counter did not advance, then just rewind and develop the 18 you have.
If for some reason you are not sure when you will reach the end of a roll of film just remember, on cameras that have a manual film advance lever, if you can not advance the film it is because you are at the end of the roll. Do not try to force it. (Assuming that you have just pressed the shutter button thereby allowing the film mechanism to advance AND that there is no mechanical problems with camera's mechanism.)
Edit: option number 3. The cheap plastic parts inside the camera specifically the take up spool with its sprocket knobs and its internal mechanics have just worn out and will not hold after it reaches a certain amount of tension.