Git fatal: ambiguous argument: unknown revision or path
Hello you guys.
I have a C# project and push on Github source control. This source has some developers working together. Today I created a new branch that is
sprint20211109_fixbug_publish_verify_messages and based on from the
But when I merge the
main branch into this branch and have some commits added but I still do not push them.
Now I want to revert/undo all those commits and don't want to push them to the origin of the current branch. I use the command:
git reset --hard origin/sprint20211109_fixbug_publish_verify_message
But I got an exception fatal: ambiguous argument 'origin/sprint20211109_fixbug_publish_verify_messages': unknown revision or path not in the working tree.
λ git reset --hard origin/sprint20211109_fixbug_publish_verify_messages fatal: ambiguous argument 'origin/sprint20211109_fixbug_publish_verify_messages': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]'
I used Git version 2.35.1.windows.2.
Thank you in advance.
Ba Một Hai Jun 24 2022
"Unknown revision or path not in the working tree." Sometimes I got this error because that branch name has not existed.
Please be sure that the
sprint20211109_fixbug_publish_verify_messagebranch is existed in your Github repo. I think you missed
scharacter at the end of the branch.
It should be
Please check again.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.