Dr. Awkward said:
It's a pretty solid rule of thumb that if you keep your Dex bonus to AC, you are aware of an attack.
Yes, you are aware of the attack, but you need to be able to see the arrow in order to deflect it.
From the PHB, p. 50:
Uncanny Dodge
Starting at 4th level, a rogue can react to danger before her senses would normally allow her to do so. She retains her Dexterity bonus to AC (if any) even if she is caught flat-footed or struck by an invisible attacker.
i.e. Uncanny Dodge let's you react defensively to something you cannot see. So she ducks, spins around, whatever, but has not neccessarily ever seen what was shot in her direction. If the arrow is still invisible while it flies through the air, (the arrow is itself invisible) and the rogue cannot see it, she cannot deflect it.
Assuming the arrow is visible to her, and the rogue made a spot roll against a diminutive, fast moving object heading right at her, she could then deflect it. I would set the DC for this at around 22 (10 base +12 size mod for the arrow). If the rogue was already aware of her attacker and knew what direction the attack was coming from, however, no spot check would be needed.
This is highly situational, of course, and up to the DM.
Edit: Under the description of the Deflect Arrows feat on page 93 of the PHB:
You must be aware of the attack and not flat-footed.
So you don't get a chance to deflect even with a spot check as I previously suggested unless you are not flat-footed.