Ripping and putting stitches back on needle

Hi, Sandra here. I’m having a heck of a time with a scarf I’m knitting. I ripped out several rows and now my stiches are reversed! I mean the pattern I had going on the right side is now coming out on the back side. I keep ripping and reknitting and can’t seem to correct it. It’s an easy pattern k row then k 2, p 1 second row alternating between the rows. How come it’s turning over?

I can only assume that when you’ve undone the rows you’ve misconceived what the next row needs to be as you’ve started to reknit.??

Or you stuck the needle in going the wrong direction.