When you opened the back the counter reset, and since the feeler mechanism in the camera felt the thickness of the film, the counter was engaged and turned to frame 1. You probably lost at least two of the last frames of the film.
Advance the film to 2, press the shutter release, then wind to 3, press the shutter release, wind, and so on until you have wound up the roll, and then remove it from the camera as normal. The counter will reset normally for the next roll of film.