Run the following commands to fix the error and recover history to a new file:

cd ~
mv .zsh_history .zsh_history_old
strings .zsh_history_old > .zsh_history
fc -R .zsh_history
0