I turned off my phone in the middle of an accidental factory reset and now it only goes to the title "Samsung Galaxy S5" screen when I turn it back on, and it stays on this screen until it runs out of battery. I've tried holding the power button down for 30+ seconds and I've tried holding the volume down button for 45+ seconds. It can still go to safe mode which gives options of rebooting or factory resetting, but rebooting it only takes it to the same title screen. Under no circumstances do I want to factory set because I don't want to lose my data. I would like to know how to turn my phone back on without factory resetting, but if there is no way for me to get my phone back on without losing data, then does anyone here know how to retrieve automatically backed up data either via Samsung or Google? I never deliberately backed up my data but I've heard that it backs up on its own.
From your description, there's likely to be a lot more problems than just that 'accidental Factory Reset'. If your phone is stuck in a boot loop that just shows the Samsung logo, it is not able to indeed run in Safe Mode. If it were, your phone would start up but it would be running only the basic Android operating system, no third-party apps or services get pre-loaded as they normally would. You would see your basic Home screen and be able to access your files and such, it's just that with the basic OS running, every app you use has to get loaded up to function.
Another contradiction is Factory Reset only wipes the user data partition, it doesn't affect the installed Android operating system. If all that was done was a failed Factory Reset, your S5 would start up normally, it's just that all your data and things would be gone. So the issue is if it is actually a matter where your phone cannot boot up past the Samsung logo, that indicates a serious issue with the installed Android operating system. It's corrupted or damaged enough so the phone won't start up normally.
Follow what
@ocnbrze recommended, you need to flash a stock Samsung ROM in order to get the operating system restored. Follow the directions on the flashing process, don't get creative and experiment. Be absolutely sure that the Re-partition option in the Odin utility is
NOT enabled, that would definitely remove your saved data. Also, your saved data does not get automatically backed up. Your Google settings and Google app config data do get automatically backed up into your online Google account, however none of your files (photos, videos, music, documents) nor your app data get backed up unless you yourself set up some kind of backup solution. Also, there's a good chance your data was deleted, powering off your phone the way you did may or may not be successful in preventing any data loss but it's not an involved process to delete data so do not get your hopes up. Typically, using the Odin utility to flash a new ROM won't wipe the data partition, it only affects the system partitions, but in this case there's apparently more issues involved.