If the bear already has your food, I would give up. I've been in this situation once when hiking with my father. My father went up to the bear and yelled. The bear reared up and roared, my father ran like hell, and the bear went back to eating our box of crackers. This seems to match up with what I've heard, which is that once the bear has your food, the bear knows that it owns the food.
One way to prevent this kind of problem is to eat dinner in the late afternoon, then hike some more, and then camp.
Also, I am asking specifically about black bears encountered in the wilderness, not those who have grown accustomed to people near camp-grounds.
Well, the distinction between backcountry and front-country, habituated versus unhabituated, is probably not that black and white. There's a whole spectrum from crowded car-camping campgrounds to remote, high-altitude areas that are far from trails and hardly ever visited by humans. Somewhere in the middle of this spectrum you have backcountry areas such as Little Yosemite and Rae Lakes that are popular enough to need bear boxes. In my experience, if you camp in areas that are not popular enough to need bear boxes, you simply never see a bear, and it's not an issue. Bears aren't like marmots, which are pretty commonly encountered even in the alpine zone at very high elevation. A bear is a big top predator that can only get enough food in either a pretty productive ecosystem (i.e., at relatively low altitude) or in an area where it can steal human food reliably and in significant quantities.