Is there a name for a fallacy when someone used an argument against his opponent, but abandoned that argument as "unimportant", "invalid" or "irrelevant" when it was turned against him?
I guess this fits under "Moving the goalpost" in some sense, even though the conversation topic was not changed, the proponent of that argument has moved the goalpost from countering that argument to countering another one without admitting that the previous goal has been achieved and was relevant.
Of course, a person may legitimately say "Yes, you're right that argument does not work but I think there is another one for my position: [...]." However, shadily acting like nothing was refuted when in fact you showed an argument to be invalid is definitely intellectually dishonest.
More generally, the fallacy of moving the goalpost is a special case of the informal fallacy referred to as "Special Pleading".
Relevant short wiki entry: https://en.wikipedia.org/wiki/Moving_the_goalposts#Logical_fallacy
Also potentially relevant: https://www.logicallyfallacious.com/tools/lp/Bo/LogicalFallacies/129/Moving_the_Goalposts