When you take the attack action with a glaive, halberd, quarterstaff or spear, you can use a bonus action to make a melee attack with the other end of the weapon. The damage die is a d4 (add attribute modifiers as normal) and deals bludgeoning damage. Otherwise, this attack functions just as if you attacked with the weapon in question.
While wielding a glaive, halberd, pike, quarterstaff or spear, other creatures provoke an opportunity attack from you when they enter your reach.