An off-duty deputy is recovering in the hospital after a man shot him during an attempted armed robbery.