PrefabUtility.RevertPrefabInstance() not working

So, I’m trying to make a code to grub the player in every scene and revert it to it’s prefab values. Something must be wrong because it doesn’t seem to be working.
I’m using PrefabUtility.RevertPrefabInstance(player); where player is a gameObject.

using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Collections;

public class zCambiarTodasLasEscenas : ScriptableWizard
 {     

public Object[] scenes; //An array with al the scenes I want to modify
 
//creating a wizard menu
     [MenuItem("Tools/CambiarTodasLasEscenas")]
     static void CreateWizard()
     {
         ScriptableWizard.DisplayWizard("Edit Scenes", typeof(zCambiarTodasLasEscenas), "Run");
     }
 
     void OnWizardCreate()
     {
//For each scene
         foreach (Object s in scenes)
         {
             string path = AssetDatabase.GetAssetPath(s); //get the scene's path
 
             EditorSceneManager.OpenScene(path); //open the scene
             GameObject player = GameObject.FindGameObjectWithTag("Player");//find the player (is a prefab instance)
             PrefabUtility.RevertPrefabInstance(player); /////////Revert the instance to the prefab values.
             EditorApplication.SaveScene(path); //Save the scene.
         }
 
     }
 }

If the prefab is disconnected from the original prefab, you may need to reconnect it first like this

PrefabUtility.ReconnectToLastPrefab(go);
PrefabUtility.RevertPrefabInstance(go);

Change this PrefabUtility.RevertPrefabInstance(player); TO THIS: PrefabUtility.RevertPrefabInstance(player go);

Please, Always consider checking Unity API Classes before start to develop a line,

RevertPrefabInstance API