What it means
Means you're chasing the wrong lead or blaming the wrong person. Comes from hunting dogs barking at a tree where they think the animal’s hiding, while it’s actually scarpered elsewhere. Handy for shutting down a bad accusation or steering someone back on track. Polite enough for work, but still has a bit of bite when you say it.
Usage examples
"If you reckon I nicked your lunch from the fridge, you're barking up the wrong tree. I brought leftovers. Check the office goblin in Accounts."
"If you think I broke the printer, you're barking up the wrong tree, I wasn't even here."
"The investigators spent weeks barking up the wrong tree before finding the real cause."
"Mate, if you think I told your boss about the party, you're barking up the wrong tree. I can't even keep up with my own gossip."
"Nah, you're barking up the wrong tree if you're blaming Sarah for the mess. She was the one trying to stop the whole circus."
Where it comes from
This one’s old hunting talk. Dogs would kick off barking at a tree, dead sure the animal was up there, when the critter had already bolted somewhere else. That picture slid into everyday English, so now if you’re barking up the wrong tree, you’ve pinned the blame or the theory on the wrong target.