I felt like I moved out of my body at lightening speed and I could see my body below. I suddenly felt like I was hugged by someone. I could not see or hear anyone. The hug felt very comforting. after a few seconds I felt scared and at that moment I came back into my body with a jolt. Then I woke up. Next day I prayed that I should not have this dream again. I have never had this dream again but always wondered about that hug that felt so comforting.
In an Out of Body Experience, as well as in a typical dream, you develop a virtual model of yourself that is separate from your physical body. You actually always have a model of yourself in your mind but in your waking life it is superimposed on your actual body. It sounds like the "hug" could have been what happened when this model of yourself went back from being separate from your physical body to being superimposed on to your physical body. This article on Out of Body Experiences might make it clearer. If you scroll down to the third paragraph from the bottom, you will read about a woman who had part of her brain stimulated, and it made her feel like there was another person, copying her movements. This was really her model of herself, but the brain stimulation somehow moved it slightly away from her physical body. This makes me think of the "hug" your experienced.