• done at the last possible moment in an act of desperation
• you can refer to your final attempt to do something that you have previously failed to do as a last-ditch attempt.
last ditch effort
• final attempt, attempt made when there is little time left
die in the last ditch
• prefer death to surrender, fight till the end