It isn’t so much the smell of coffee grounds and their rich, bitter scent that might keep deer away from your garden, it’s the possibility that they might encounter or run to humans if they do, that might keep them away.
There is, however, no evidentiary proof that deer don’t like the smell of coffee grounds, and whether or not they will act as an effective deterrent is dependent on the deer in question having encountered humans and associating the smell of coffee with mankind. It’s a lot of maybes and too many “possibly’s” to rely on, so we wouldn’t recommend that you put your faith in coffee to chase deer away.