DEV Community

Cover image for Fix fatal ambiguous argument 'HEAD^ in Zsh with HEAD^
Pierre-Henry Soria ✨
Pierre-Henry Soria ✨

Posted on

Fix fatal ambiguous argument 'HEAD^ in Zsh with HEAD^

When using git reset HEAD^ in your Zsh terminal, you may receive this error "fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree."

If you do, you will have to add setopt NO_NOMATCH in your ~/.zshrc file to allow unmatched wildcard expressions.

Open your .zshrc, then add the following

# Allow unmatched wildcard expressions in Zsh
setopt NO_NOMATCH
Enter fullscreen mode Exit fullscreen mode

Then, just reload .zshrc by typing source ~/.zshrc in your terminal, and you shouldn't face any other issues when using git reset HEAD^ with the caret ^ symbols.

Happy Coding 🤠 Enjoy 😊

Top comments (0)