If your phone/tablet is empty you lose connection to the dji go app, depending on your settings (land/hover/RTH) it should do just that.
in your case, you would first put rth on a hight higher then any obstacles (the trees) in de settings, so then it would climb to that hight above the trees...