Game restarting even though it's not called.,My game will restart when not called.

using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
bool gameHasEnded = false;
public void EndGame ()
{ if (gameHasEnded == false)
{
gameHasEnded = true;
Debug.Log(“GAME OVER”);
Restart();
}

    }
    void Restart ()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().name); 
    }
}

If you using Visual Studio, if you press Shift + F12, you can see the references using this method.

Hi mate =) @tormentoarmagedoom is right you are proably missing somewhere but it is easy to find where you miss =) .Firstly could you try to disable all c# scripts in your scene when you do this game shouldnt be restarted anymore .Then could you check your c# scripts in your scene which have a connection with your GameManager.EndGame() function .Problem is proably that in some script there is a line which calls void EndGame(){} or which calls void Restart(){} .Good luck and have fun =)