How do I get an animation to restart when button is hit?

I have a player character with the ability to throw objects infinitely. When the throw object button is hit I want it to play the throw animation all the way through, and then switch back to the non-throwing animation. The exception to this is if the throw object button is hit while the throw animation is going, then I want it to restart the throw animation, but I am having trouble getting it to do this.

What I currently have is a player character that will go to throw animation when the throw object button is hit but I do not have the part to restart the throw animation if its pressed again while still in the animation

How would I do this and is it possible to do it in the animator?

There is a checkbox which says “can transition to self” on the Animation in the Animator. This should allow the animation to transition to the same animation again when you have a transition from “any state”. Then you should be able to retrigger the same animation just the way you already trigger the animation anyways.