I've been experiencing this since over a week now. I am not able to bring my foreskin back when my penis is erect. If I try to do that, it hurts a lot and the skin on one side becomes a bit red. When not erect it does come down, but then it also hurts if it is stretched. This never used to happen two weeks before. I can see few old dead skin coming off from the side that is not able to stretch.
Most likely you have an infection in your foreskin. The best thing to do is see either your family doctor or a urologist about the problem.
Thank you, sir, for your help.