Go back Button from a collection page to a specific tab. please help

Client ask for this:

We noticed that when we click on the “Go Back” button for Accessories that it takes us back to the default tab (“Cables”, in this case). It should go back to the tab we were on before (“Miscellaneous” when going back from an item on that tab, “Cables” going back to the cables tab, and “Fan & Grill Filters” going back to the fan & grill filters tab). Right now they all take us back to the cables tab. We are having the same problem with the Power Supplies. The “Go Back” button takes us back to the default 600W+ tab instead of the tab we came from. Please make sure this is fixed. Thank you.

Please help me…