Sometimes, naturally, user story or any other task is not finished during the sprint. You are definitely not the first, or the least person that this has happened to, and it is really not that big of a deal. The important thing is what happens after the „incident“.
Our agile team brings few experienced advice on how to approach the given problem. The user story not been started, or it has been started but not finished, or a bug has been found – everybody’s been there. Davor Čengija emphasizes that there is neither a code of conduct in those cases, nor will the Scrum police come knocking on your front door if you do something not according to the regulative, but advice that you can read here will surely help you.
If you are looking for a place to find a lot on different agile topics – visit todo|doing|done blog.