Beginner knit and purl stitch mistake!

Hi there,
I’m a beginner knitter, and a friend taught me how to to a knit-purl stitch. I just restarted knitting this hat after a while, and something went wrong with the first few stitches, so I tried to undo them, but I’ve only been shown how to do it once and I don’t think I remembered right… and now my thread seems to be stuck three stitches back… no idea how to fix it or what I’ve done! I’ve attached some pictures (three from the front and one from the back). Any help very gratefully received!

Thank you,

From the back:

Slide those 3 stitches to another needle and knit them again.