Hi there thanks for writing in
It sounds like you have put in quite an awkward situation and it’s understandable that you may be left feeling a bit confused.
When a teacher tells you to do something it can be confusing as often young people are used to being told that teachers are right and that you should do what they say. This is not always true, teacher can do things that are wrong and you should never have to keep anything a secret that you feel uncomfortable with, no matter who tells you not to say anything. You always have the right to talk about it with your parents/carers or anyone else you feel you can trust.
In this situation it may be an idea to go to the head teacher with your friend and tell them when exactly what happened, you have done nothing wrong and you are allowed to talk about this. If you feel too nervous you could perhaps ask a parent or carer to come with you for support.
You are welcome to come to 1-2-1 to talk further with a counsellor or you can ring Childline on 0800 1111.
Take care
Sam