this should work (HK crosses his fingers), just follow my instructions:
(I'm *NOT* doing the code for an Objectlist as it's much more complex being harder for me to give instructions and for you to follow it, so you'll only be able to go back to the immediate previous room with this code, if you really want to be able to select from multiple previous rooms, then let me know, but it'll be harder for me to guide you through it and for you to follow it as it involves the use of List and Dictionary Attributes)
you need to create~add these 3 Attributes:'player' Player Object -> 'Attributes' Tab -> Attributes -> Add -> (see below, repeat as needed)
(Object Name: player)
Attribute Name: old_room // or whatever you want to call it instead
Attribute Type: object
Attribute Value: room // or whatever is your starting room that the player is in at the start~beginning of your game
(Object Name: player)
Attribute Name: current_room // or whatever you want to call it instead
Attribute Type: object
Attribute Value: room // or whatever is your starting room that the player is in at the start~beginning of your game
(Object Name: player)
Attribute Name: changedparent // do NOT rename this, it MUST be: changedparent
Attribute Type: script
Attribute Value: (see below)
(change my use of 'old_room' if you called it something else, to that something else)
(change my use of 'current_room' if you called it something else, to that something else)
add new script -> variables -> 'set a variable or attribute' Script -> (see below)
set variable player.old_room = [EXPRESSION] player.current_room
add new script -> variables -> 'set a variable or attribute' Script -> (see below)
set variable player.current_room = [EXPRESSION] player.parent
and for your 'back' Command:Command Name: whatever you want to call it
Command Pattern: back // or: goback, or: whatever you want
Command Script: (see below)
(change my use of 'old_room' if you called it something else, to that something else)
add new script -> variables -> 'set a variable or attribute' Script -> (see below)
set variable player.parent = [EXPRESSION] player.old_room
---------
even if you don't understand how it works, it should (HK crosses his fingers that there's no errors or logic oversights on his part) work for you!

it'll work for any type of situation, for examples:
your travel: room -> room1 -> room2
the back command moves you back to 'room1'
your travel: room -> room99 -> room5
the back command moves you back to 'room99'
and if you were to use the back command again now being in room99 from the above example, you'd go back to 'room5'
and if you were to use the back command again now being in room5 from the above example, you'd go back to 'room99'
etc etc etc
----------------
P.S.
hopefully, you understand that if you're using a different name for your Player Object than the default name of 'player', then you got to change my use of 'player' in all of the code lines above to the name that you're using for it.