Rescue or Safe mode on a Pixhawk or APM Is it possible?

Thanks again for all the help the people on this board has given me.
Question is it possible to setup a helicopter with a Pixhawk or APM to perform something like a rescue or safe mode? Could a Pixhawk be setup for something like flipping a switch would have the unit climb to a preset altitude, and then go to like loiter or position hold or alt-hold mode? Would this work if the helicopter was on it’s side or out of control, could it self right itself?
Thanks again, just curious

Yes it can do that. RTL or rally points.

Thanks again but can someone explain in more detail how to set this up correctly?
What is rally points?
Thanks

google is your friend “Arducopter rally points”

Or have flight mode buttons mapped on the radio so you can switch to RTL instantly meaning you can press the button and the arducopter software will take over and land the helicopter for you. Typically you need to set up a mix on your radio that says this switch sets that channel to so many milliseconds, and the ardupilot needs parameters set to watch that channel for switching flight modes, and set up to use the ms pulses sent to that channel to look up what flight mode that refers to.

I hope I’m not breaking any rules posting the following video, if I am please feel free to remove it and PM me to tell me off: