When a creature you can see misses you with a melee attack roll, you can take a Reaction to force the attack to target another creature other than the attacker within the attacker's reach. Use the existing attack roll against the new target's AC, dealing damage as normal on a hit.
You can take this Reaction a number of times equal to your Dexterity modifier (minimum of once). You regain one expended use when you finish a Short Rest, and you regain all expended uses when you finish a Long Rest.