putting the cart before the horse; mistaking the means for the end; getting one's priorities backwards
reversing the order of (relative) importance (of); putting the cart before the horse; the tables being turned; mistaking the insignificant for the essential; mistaking the means for the end
reversing the order of (relative) importance (of); putting the cart before the horse; the tables being turned; mistaking the insignificant for the essential; mistaking the means for the end
to lose one's presence of mind; to lose one's head; to be thrown off balance; to get upset; to be bewildered; to be flustered
watch your step; slippery floor