I heard about a foolproof way to keep deer out of your garden.
Deer can eat your whole garden, and short of a six foot chain link
fence, there is only one other foolproof for guaranteeing that deer
cannot eat your backyard garden.
A tall fence is expensive, but it will keep deer out of your
backyard, and occasionally provide a free meal:

Deer can even get into your pumpkin patch:

The best way to keep deer away from your garden is to use the B. F.
Skinner operant condition approach as he mentions in the book “Walden
Two”. It’s a simple aversion techniques that is guaranteed to keep
deer away from your garden or backyard.
Deer love peanut butter
It’s well know that deer love peanut butter and they can smell it a
mile away:
The best way to keep deer out of your garden is to follow
these steps:
1 - Buy a few jars of cheapo peanut butter at the dollar store
2 –
set-up an electric wire at 3-4 feet above the ground
3 – Dip some
rags in the peanut butter and tie it to the electrified fence
The deer will be attracted to the peanut butter, start licking and
find it to be a rather shocking experience and the deer will quickly
learn to avoid your garden.