Close Quarter Ranger (5e Feat)
From D&D Wiki
Close Quarter Ranger
When an enemy attacks you, you may expend your reaction to use one of the following effects:
If a creature hits you with a melee attack, you can reduce the attack's damage by an amount equal to your Dexterity modifier.
If a creature misses a melee attack against you, roll initiative against the attacker's attack roll. If your initiative is higher, you can make one melee attack against the attacker or attempt to grapple them.