- master can be changed to other dev
- add all files
- reset commit
- HEAD^的意思是上一个版本,也可以写成HEAD
1,如果你进行了2次commit,想都撤回,可以使用HEAD2
- can be commit id or HEAD or sth. else
- things that happens
- make your current branch (typicallly master) back to point at
- make the files in your working tree the same as the version committed in
- make the files in the index the same as the version committed in
- all uncommitted changes will be throwed away - this is a potentially dangerous command, since all the uncommitted changes will be discarded.
- you should always check that the ouput of
git status
is clean before using it.
- find . -name ".git" | xargs rm -rf
git commit --amend
git commit --amend -m "some message"
rm -rf .git
echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin [email protected]:sucongCJS/test.git
git push -u origin main
git remote add origin [email protected]:sucongCJS/test.git
git branch -M main
git push -u origin main