cart before the horse
Putting the cart before the horse is doing something in the opposite or reverse order, as in "Don't put the cart before the horse."
He put the cart before the horse when he bought the house before he got the loan."
putting the cart before the horse
Doing things in the wrong order.
"She's buying a lot of new furniture before she has a job. She's putting the cart before the horse.