One key to switch between two materials??

I have a table that switches from the standard texture to another texture (redTex) when I tap the screen on the smartphone. My question is, how can I get it to switch back to the standard texture, when I tap again??

Here’s my script:

var redTex : Texture2D;

function Update () {
	 if (Input.touchCount == 1)
{
    	if (Input.GetTouch(0).phase == TouchPhase.Began)
    	{
			renderer.material.mainTexture = redTex;
}
}

Try this:

var tex : Texture2D;
 
function Update () {
     if (Input.touchCount == 1)
{
        if (Input.GetTouch(0).phase == TouchPhase.Began)
        {
        var texT = renderer.material.mainTexture;
         renderer.material.mainTexture = tex;
        tex = texT;

 }
}