How to revers uncompleted animation and stop ?

I have two objects. when they touch each other they stars to glow. but when they are separated they don’t should not completely become unglowing(Not glowing). They should gradually decrease there glowness until it becomes zero. How can I achieve this with Animation ?
I just started learning Unity (Self study and YouTube) 4~5 days ago so i am really noob

here is what I have done until now.

private void OnCollisionEnter(Collision other) {
    if(other.gameObject == player.gameObject) {
        anim.SetFloat("Direction",1);
        anim.SetBool("touching",true);
        anim.Play("Heat");
    }
}

private void OnCollisionExit(Collision other) {
    if(other.gameObject == player.gameObject) {
        anim.SetFloat("Direction",-1);
        anim.SetBool("touching",false);
        anim.Play("Heat");
    }
}

This give me what I partially excepted result but objects immediately glow to full intensity and then they dim out but I don’t want then to glow to full intensity.

PS: sorry for my Bad English. its not my native language

private void OnCollisionEnter(Collision other) {
if(other.gameObject == player.gameObject) {
anim.SetFloat(“Direction”,1);
anim.SetBool(“touching”,true);
anim.speed = 1.0f;
anim.Play(“Heat”);
}
}

 private void OnCollisionExit(Collision other) {
     if(other.gameObject == player.gameObject) {
         anim.SetFloat("Direction",-1);
         anim.SetBool("touching",false);
         anim.speed = -1.0f;
         anim.Play("Heat");
     }
 }

I took your code and edited it to include a change in speed to -1.0f on the animator component. That should do the reverse of any animation that is playing. I set it to 1.0f on the collision enter script just to make sure that future encounters it won’t go backwards and any other animation will also run backwards while the speed is -1.0f. Another solution is to go into the import settings and under animations, add an additional animation which is the exact same as the “Heat” animation, set the play speed to -1 and call it “Unheat”, now you have an additional animation that plays backwards, this would be better in the case that there are other animations which or going to run as well