Sorry you had such a terrible nightmare. Remind yourself that
you are safe and what you experienced in the nightmare is about your past and is not happening now.
Maybe it would help to visualize a different ending to your dream to help lessen that feeling of being powerless. Sometimes I think my mind wants a resolution to things in my past and it can help me to close my eyes and imagine a safer version of the nightmare.