Reverse animation after playing with a button

I have a simple animation of up and down. So if i press and hold A, it goes down and stops whenever I release it.

 private Animator Anim;
    private bool flu = false;
    
    void Start()
    {
        Anim = gameObject.GetComponent<Animator>();
    }

        void Update()  
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            Anim.SetBool("flu", true);
            Anim.speed = 1f;
        }
        else if (Input.GetKeyUp(KeyCode.A))
        {
            Anim.speed = 0;
        }

But I wanted to make it go back aka reverse the animation when i press and hold S, and stops when I release it.
I tried:

private Animator Anim;
    private bool flu = false;
    
    void Start()
    {
        Anim = gameObject.GetComponent<Animator>();
    }

        void Update()  
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            Anim.SetBool("flu", true);
            Anim.speed = 1f;
        }
        else if (Input.GetKeyUp(KeyCode.A))
        {
            Anim.speed = 0;
        }
        else
        {
            if (Input.GetKeyDown(KeyCode.S) && flu)
            {
                Anim.speed = -1f;
            }
            else if (Input.GetKeyUp(KeyCode.S))
            {
                Anim.speed = 0;
            }
                
        }
    }

But it didnt work, care to help?

Solved. To anyone that might need this in the future.
Setting speed to -1 apparently doenst work in unity script. So you would need to add a float and add it to the multiplier in the animator.

Then the script is as follow:

    private Animator Anim;
    private bool move= false;
    
void Start()
    {
        Anim = gameObject.GetComponent<Animator>();
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            Anim.SetBool("move", true);
            Anim.SetFloat("Speed", 1.0f);
        }

        else if (Input.GetKeyDown(KeyCode.W))
        {
            Anim.SetBool("move", true);
            Anim.SetFloat("Speed", -1.0f);
        }

       
        else if (Input.GetKeyUp(KeyCode.Q) || Input.GetKeyUp(KeyCode.W))
        {
            Anim.SetBool("move", false);
            Anim.SetFloat("Speed", 0);
        }
    }