How to Replace an Existing Website File in cPanel Safely
cPanel · Self-help guide
Before replacing a website file, it is best to keep a backup copy in case something goes wrong. Log in to cPanel and open File Manager. Go to the folder that contains the file, usually public_html. Right-click the existing file and choose Rename. Add something like .old to the end of the filename, for example index.php.old. This keeps the original file available. Next, click Upload and upload the new replacement file. Confirm the new file has the correct name, such as index.php. Visit your website in a private browser window to test it. If there is a problem, delete the new file and rename the backup file back to its original name.