It seems that you suffered from benign paroxysmal positional vertigo (BPPV), one of the most common causes of vertigo — the sudden sensation that you're spinning or that the inside of your head is spinning.
Even after successful treatment for your BPPV, it can come back. However, you can come up with a plan at home to help keep future bouts at bay. You should:
Be aware of your chances of falling.
Sit down at once if you feel dizzy.
Use good lighting if you get up at night.
If your BPPV comes back, you can take steps to deal with your symptoms until you see a doctor. For instance, you can:
Avoid sleeping on the affected side.
Sleep with two or more pillows under your head.
When you wake in the morning, lift your head slowly and sit on the side of the bed for a moment before you stand up.
Avoid bending over to pick things up.