When you are unarmed and defending against a knife attack, you have options.
The safest option is to maintain situational awareness and learn how to read pre-attack indicators. As soon as you become aware of a possible attack, create distance – run! Note that some attacks cannot be predicted no matter how situationally aware you may be (ambush attacks).
The next option is to place objects between yourself and the attacker to make it more difficult to stab you and you can use the object to hit or distract to afford you the opportunity to get away.
The most risky option is to engage in close quarters combat. Many things can and do go wrong when engaging in close quarters combat. When engaging in close quarters combat many things have to happen simultaneously i.e. you have to anchor the weapon to prevent it from being used and ensure at the same time that he does not switch hands, you have to neutralize the attacker with a deadly force strike(s), you have to remove the weapon from the attacker and you have to get to safety, all in a matter of seconds. This is extremely difficult and many things can and do go wrong i.e. you may not see him switching hands, you may trip and fall, he may stab too fast and you may be unable to anchor the weapon, your deadly force strikes may not affect him because he is under the influence of narcotics etc.