WP-CLI: detect altered core files and restore them automatically

Just reinstall the current version of WordPress Core with:

wp core download --force

For a bash script, check here: https://dannyvankooten.com/periodically-check-wp-core-file-modifications/