If you gathered data for a manuscript, you should generally be given a chance to participate in the writing of that manuscript and to become an author of the resulting paper. Moreover, it sounds like this was an explicit understanding at the time when you started the project, in which case it would be even more clearly inappropriate to renege without a clear discussion.
Regarding what you should do: the first key question is whether you have documentation of the earlier plans the PI had made with you, e.g., in email. If so, then you have a much clearer and less ambiguous position. If not, then it is possible that there might be a legitimate misunderstanding---or that the PI might attempt to convince people that this is the case.
I would then recommend beginning by talking with your advisor. I would also recommend approaching the subject not by claiming that you have been wronged, but from a perspective of discomfort and concern about the situation. Your advisor will probably have longer experience with this colleague and a better outsider perspective and can hopefully help to either mediate the situation or else point you to the appropriate people in the department or larger university who can do so (e.g., ombudsmen). The best case scenario, however, is that this can all be sorted out amicably with a minimum of fireworks, and a quiet approach beginning with your advisor is a likely good path for doing so.