Does a bracha said after eating a specific food rely on the food being eaten or on the bracha (and its intention) made at the beginning?
If, hypothetically, I make a shehakol at the beginning and then find out that the food I am eating (or "I have just finished eating") should have demanded a mezonot, would my bracha achrona be a borei nefashot (as it called forth by the intention/awareness I had when I said the bracha before eating) or an al hamichya (as it is called forth by the particular food that I ate, whether I knew it at the time or not)?
The Shehakol, bedieved, seems to have been acceptable according to the Rambam in this answer.