You could add these commands to your deploy script, change main to the branch where you're pulling from
git fetch origin main
git reset --hard origin/main
git fetch origin main Fetches changes from the remote main branch
git reset --hard origin/main Resets the branch to match the remote main branch
These commands will reset the branch on your server to match the remote branch. If you for example made a change to any of the branch files on the server these changes will all be lost. Its important that you understand what these commands do.
I personally use this myself to avoid conflicts and I never make any changes directly to the server branch files.