If you were using bash, instead of zsh, you could use these techniques to remove a command from history:
Press up-arrow to get to the line, then press Ctrl-U to erase it. Don't press ENTER, instead press up or down arrow to go to another history line.
The line you want to erase will be replaced by an empty line. I don't know if this is documented anywhere, I noticed it by accident several years ago...I guess the erase is just a fairly thorough :) edit of the history line.
e.g instead of pressing ^U to clear the line, change something instead. DON'T HIT ENTER, as that would create a new history entry. Press up or down arrow instead. The line is now changed permanently in the history, as you can see by by using up/down arrow to bring it back into view.
By permanent, I mean that after pressing up/down arrow keys, the line will remain changed even if you hit enter on a new/edited command. Only the edited line will remain in history replacing the original, and will get saved to your $HISTFILE as usual when you exit that shell.
You can press ^C to abort either an edit or ^U erase, to stop it affecting the history.
Another method is to use history -d
if you know the history line number. For example:
$ history | grep history | tail
[...irrelevant, deleted...]
10113 help history
10114 history | grep history | tail
$ history -d 10113
$ history | grep history | tail
[...irrelevant, deleted...]
10113 history -d 10113
10114 history | grep history | tail
The help history
line was deleted by the history -d 10114