Back and Back not Save in do. How does it work

Hi everyone, I am a new member and hope everyone can help me. I have a small problem that I have not figured out how to solve. I do not understand the two buttons, the back button and the backnosave button. I assume the system's default screen is screen A. When you click from the menu to a screen, it is screen B (displaying a list). When you click to edit a record in screen B, it will go to screen C (displaying a detailed list).

The story is: when on screen B and screen C, there will be a back button. when I edit a field in screen C (without saving) and click back, it will go to screen B. click back again in screen B, it will go to screen A. after clicking back, it will display a message: There is an unsaved record, do you want to save it with 3 options: yes, no, cancel

What I want: If it works correctly according to the logic, when editing a field in screen C, clicking back, it will display a message and ask what to do with the unsaved record before returning to screen B. not from screen B, clicking back again to screen A, then displaying that message

I have briefly learned about the back button and the backnosave button in the system, I have tried a few ways but I still don't see it working as I want. What do I need to do to be able to work according to the logic I want. Thank you for your comments