Unity won,Unity stopped recognizing gameObjects in scripts

,So… weird question… I had a quick game set up, and everything was going great, and then I edited one script and Unity basically stopped using gameObjects? I get the error that GameObject does not contain a reference to SetActive or AddConponent and I don’t know how to fix this, or how just get a backup that can revert my project to before this happened. Please help.

Here’s a basic example of the simple things I’m trying to do with it:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyHealth : MonoBehaviour
{
    public GameObject heart1;
    public GameObject heart2;
    public GameObject heart3;
    public float health = 30f;


    // Update is called once per frame
    void Update()
    {
        if(health >= 29 && health <= 31)
        {
            heart1.SetActive(true);
            heart2.SetActive(true);
            heart3.SetActive(true);
        }
        if(health >= 11 && health <= 20)
        {
            heart1.SetActive(false);
            heart2.SetActive(true);
            heart3.SetActive(true);
        }

        if(health >= 1 && health <= 10)
        {
            heart1.SetActive(false);
            heart2.SetActive(true);
            heart3.SetActive(false);
        }

        if(health == 0 || health <= 0)
        {
            heart1.SetActive(false);
            heart2.SetActive(true);
            heart3.SetActive(false);

            Destroy(gameObject, 0.5f);
        }
    }

    void OnCollisionEnter(Collision collision)
    {
        if(collision.gameObject.tag == "Spell")
        {
            health -= 10;
        }
    }
}

Make sure all the scripts that have that error has this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

If it doesn’t work, copy the code, create a new script and paste the code into it, then delete the old script. If it doesn’t work, maybe can be a Unity’s configuration problem. Have you changed something in Unity preferences or configuration?