How to update ZSH and maintain local changes

tl;dr

cd "$ZSH" && git stash && upgrade_oh_my_zsh && git stash pop

Step 1: Navigate to the ZSH directory

cd ~/.oh-my-zsh

Step 2: Stash your local/untracked changes

git stash

Step 3: Run the automatic ZSH update

upgrade_oh_my_zsh

Step 4: Recover your changes

git stash pop