Realize I am writing this as a LEO, but I would comply with what the officer is doing and then argue in court. It is never a good idea to argue on the street with an officer; the officer will win. Bad things will happen.

I would research the statute that I was written a citation under and see if I was in the right or wrong. In this situation we are discussing, you would discover your knife was within the legal definition and thus, not illegal (barring the length of the blade isn't an issue by the definition).

I would then bring that argument to court with me and discuss the issue with the prosecutor and want a dismissal if I am in the right and a note or letter from the prosecutor to the law enforcement agency stating it was okay to release the knife back to me and that the case was dismissed due to whatever reason. If the knife wasn't illegal, then they should be willing to return it at the end of the case, but it probably will take the letter from the DA to get it back.

Then, if you want to push the issue, you can file a complaint against the officer with his department on the argument that he wrote an unlawful citation and provide the documentation you provided to the court and whatever letter or note you obtained from the DA, if any. He wouldn't get fired for something like this, but it would be in his permanent file and most likely, he would need to show an understanding of the issue to his sergeant or lieutenant so it wouldn't happen again. The disciplinary issues are not public documents, so you may not hear the resuls of it, depending upon the agency and how transparent they are. Some are very transparent and some are very closed. Most are in the middle.

If you really want to push the issue, you can sue, but your loss is minimal and it would be difficult to get an attorney to represent you in it.