Salwomir Langa, 28, was masked with a balaclava when he walked into the Sunrise Takeaway in Niddrie Mains Road, Edinburgh, just minutes before closing time in August of last year.
Langa, a Polish citizen, threatened shop worker Hung Sang Fong with a knife, but Mr Fong refused to be intimidated and started struggling with the robber. Mr Fong tried to grab the knife from Langa and suffered minor cuts as a result.
A neighbour called the police and then shouted to Langa, telling him they had made a 999 call and he fled empty-handed.
Langa pleaded guilty before Sheriff James Scott at Edinburgh Sheriff Court last month and sentence was deferred until yesterday for background reports.