When checkout encounters an error of "fatal: reference is not a tree", follow the steps below to handle it
1. Git checkout switch to the main branch
2. git pull updates the main branch to the latest version
3. Checkout branch code
When the branch code version is larger than the main branch code version, the above error will appear. At this time, just update the main branch code.