I once had an officer tell me to get on the sidewalk. I asked for his name and badge number, and he gave them to me (by law they have to if a citizen asks). I then e-mailed the chief of police, quoting the part of the Municipal Code that forbids bicycles from the sidewalk, and asked why an officer would order a citizen to do something illegal.
I got a very nice reply to the effect that this passage from the Code would be incorporated into the next day's rollcall briefing.