<b>Galaxy S5 auto restart issue may occur because of a number of reasons </b>
Can you please tell me what is the notice you received?
1 Galaxy S5 Overheats - This is a major problem of the S5, when running heavy and CPU consuming applications your S5 tends to restart by it's self. You can fix this issue by using various temperature and battery testing apps.
2 Auto Syncing and Updating- When both of these are running simultaneously in the background. It tend to interference with new changes and incompatible updates with your firmware. For example when apps are updating automatically while syncing your Gmail and other Email clients. Disable these.
>Navigate to settings