// Suppose I reference the gameObject “Button” through the inspector…will the variables “Button” and “num” still remain in memory or will they be deleted?
Loose references only get collected when there is no connection to them anymore. Disabling an object just tells Unity to not run functions (such as Update) for that object. It still very much exists. So yes, the state of the object remains unchanged when you disable and enable it.
To be even more specific. If a game object is disabled (or just a script/component) on the game object, no Awake/Start/Update/FixedUpdate/LateUpdate/OnGUI/OnEnable/OnDisable function in your script will run. Your variables will keep their assigned values however.