Drug user Liam Evans was wearing a balaclava when he walked into Osmondthorpe Convenience Store shouting and demanding cash as he waved a knife at the shopkeeper.
Leeds Crown Court was played CCTV footage which showed Evans lunging at the shopkeeper, who fought him off with the pole and knocked the knife out of his hand during a struggle at the shop on Osmondthorpe Lane.
The shopkeeper suffered a cut finger during the incident, which happened just before 11pm on July 25 2019.
Evans, 32, of no fixed abode admitted attempted robbery and threatening a person with a knife.
He was jailed for four years and two months.
Prosecutor, Carmel Pearson said: "He kept a wooden pole behind the counter, He had already been robbed four times."
Miss Pearson added: "The defendant lunged towards him first of all. He then defended himself with the pole."
Police recovered traces of DNA from the knife and the shopkeeper was able to identify Evans.
Miss Pearson said the shopkeeper is suffering from high levels of stress and anxiety and has nightmares following the incident.
Evans has five previous convictions for 13 offences, including possessing a knife in the same shop in 2016, arson and harassment.
The court heard Evans has written a letter of apology to the shopkeeper.
Philip Mahoney, mitigating said: "His remorse appears genuine, as does his determination to change."
Jailing Evans for four years and two months, Judge Simon Phillips QC, said: "You can be seen to lunge at him with the knife. He describes it as trying to slash at him with that knife."
Judge Phillips imposed an indefinite restraining order banning Evans from going within 50m of the shop or from contacting the shopkeeper.
After the sentencing hearing, Detective Inspector James Entwistle, of Leeds District CID, said: “Evans put the victim through a frightening ordeal at knifepoint, during which he lunged at him with the knife causing an injury to his hand. The victim very bravely fought back forcing Evans to flee empty-handed.
“We always treat offences of this nature very seriously and we hope that seeing Evans brought to justice will provide some reassurance to the victim and serve as a warning to others.”