Tab to return to root of page

Hello, my app has 4 tabs. Tab1 has a list, and tapping any item in the list will go to a detail page within the tab. If I press tab2, then press tab1 again, tab1 still shows the details page instead of the list page. If I press tab1 again, it then shows the list.
How can I set the tabs to always return to their original content (tab1 to return to list)?