Robert Gray who has 88 previous convictions left M&S worker Scott Thomson unconscious after he raided the M&S Foodhall in Dundee.
The High Court in Edinburgh was told that Mr Gray thought that he killed Mr Thomson.
Mr Gray was on four bail orders at the time of the attack last October. Previously he had admitted to assaulting the 47-year-old employee with severe injury, permanent disfigurement and danger to his life.
Along with the attack he also admitted to breaking into the premises and stealing food.
The Court heard that Mr Thomson was working at a loading bay when he heard the sound of glass breaking at the front of the store which led him to go and investigate the noise.
Mr Thomson called the police and took it upon himself to enter the shop where the accused had thrown the bottle at the victim. The accused had repeatedly hit the victim over his head with a class bottle resulting in him passing out.
The victim suffered from multiple skull fractures with internal bleeding to his head and has been left with scaring.
Defence solicitor advocate Mr Gilmartin told the Court that the accused went to the store with the intention of breaking a window to steal bottles of drink but had falling in. After the attack the accused was then very concerned that he had killed Mr Thomson as he was not moving.