This is an informal fallacy whereby an opponent attempts to undermine your argument by arguing that you are a hypocrite. It could be viewed as a poisoning the well or a straw man. In the former case, in essence, by alienating the listener to you personally by claiming you are guilty of hypocrisy, the opponent hopes to shift the focus of attention away from the argument to your credibility. Of course, it's a fallacy because hypocrisy requires that you must currently be engaged in said action, belief, activity, etc, or that there isn't a false equivalency between what you do and say because of subtle but important differences. The straw man might come into play if your opponent misrepresents your position by conflating your past position for your current one.
But the best fit for the name of this fallacy is called the whataboutism a subspecies of tu quoque. From WP:
Whataboutism, also known as whataboutery, is a variant of the tu quoque logical fallacy that attempts to discredit an opponent's position by charging them with hypocrisy without directly refuting or disproving their argument.
The classic example listed by the article is that of Soviet apologists who in defense of their regime's human rights violations would attack the US on the basis of historical slavery and Jim crow and point out that African-Americans in the US are currently still disproportionately poor and disadvantaged in many ways. Note that the history is irrelevant to the US indictment of Soviet abuses of human rights, and that despite the inequity in US society between black and whites statistically speaking, it is a brazen false equivalence with Soviet oppression of the individual. Political repression in the former Soviet Union was fundamentally different than the systemic racism in the US in several important ways.
Let's do a quick example of bad reasoning drawn from the historical origins of whataboutism, in response to US criticism of human rights abuse, the argument may be made:
P1 The US has in the past engaged in slavery, and therefore is hypocritical.
P2 Anyone who engages in such hypocrisy regarding civil rights has no valid point in regards to our treatement of our citizens.
C Any and all criticisms therefore of our treatment from the US are not cogent.