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)