Modifying mesh vertices temporarily

In an effort to increase the height of vertex positions of an instantiated mesh prefab at runtime (in this case a simple cylinder I created in Maya), I find the changes become permanent when I return from play mode. In order to get the shape back to the original cylinder, I have to right click the prefab and reimport it. When looking through the meshFilter.sharedMesh doc, I found this:

“It is recommended to use this function only for reading mesh data and not for writing, since you might modify imported assets and all objects that use this mesh will be affected. Also, be aware that is not possible to undo the changes done to this mesh.”

I’m curious if anyone has had any success with modifying an existing prefab during runtime such that it isn’t permanently affected when I return to edit mode. My code is pretty standard, but I’ll post it in case I’m missing something obvious. Thanks in advance!

void RaycastBelow(){

		RaycastHit hit;
		Collider currentColliderHit;
		if (!Physics.Raycast (transform.position, new Vector3 (0f, -1f, 0f), out hit)) {
			return;
		}
		currentColliderHit = hit.collider;

		MeshCollider meshCollider = hit.collider as MeshCollider;
		if (meshCollider == null || meshCollider.sharedMesh == null){
			return;

		}

		mesh = meshCollider.mesh;

		vertices = mesh.vertices; 

		int[] triangles = mesh.triangles;

		vert1 = triangles [hit.triangleIndex * 3 + 0];
		vert2 = triangles[hit.triangleIndex * 3 + 1];
		vert3 = triangles[hit.triangleIndex * 3 + 2];

		p0 = vertices[vert1];
		p1 = vertices[vert2];
		p2 = vertices[vert3];

		Transform hitTransform = hit.collider.transform;

		p0 = hitTransform.TransformPoint(p0);
		p1 = hitTransform.TransformPoint(p1);
		p2 = hitTransform.TransformPoint(p2);



		if (Input.GetAxis ("AButton") != 0) {

			vertices [vert1] += Vector3.up * Time.deltaTime;
			vertices [vert2] += Vector3.up * Time.deltaTime;
			vertices [vert3] += Vector3.up * Time.deltaTime;

			mesh.vertices = vertices;

			Destroy(meshCollider);
			meshCollider = hit.collider.transform.gameObject.AddComponent<MeshCollider>();
			meshCollider.mesh = mesh;

			mesh.RecalculateNormals();
			mesh.RecalculateBounds ();
		}


	}

For anyone else who runs into this problem, line 16 should be
substituted with:

mesh = hit.collider.transform.GetComponent ().mesh;

Can anyone explain why the meshCollider.mesh returns the actual mesh but the other line returns the instance of the mesh?