Make the back button point to an earlier screen instead of the confirmation screen

I have this kind of user flow in my app:

login > select date > select type of data > enter amount > confirm

The user can also go to settings from anywhere in that flow.

I am using <ion-nav-bar> and <ion-nav-back-button> for navigation.

When the user confirms his entry, he is routed back to

select date

When he get’s there, the back button points to confirm. Is it possible to make the back button forget about everything that has happened between the last time he was on select date and now, and have the back button point to whatever was the last screen before that?

Before leaving confirm state you can do:

$ionicHistory.nextViewOptions({
   historyRoot: true
});

To set next view as root in your hitory

Thanks! That’s a cool property that I had not used before.

But I see that with that, there is no back button on select date.

If the users path was:

login > select date > select type of data > enter amount > confirm

then I still want the user to be able to go back to login. I want to cut off the navigation path at the last time when the user was at select date, so that only this path is left

login > select date

I still want the user to be able to go back to login. How can I do that?