markdown Git作弊表

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Git作弊表相关的知识,希望对你有一定的参考价值。

Remove staged file 
```bash 
git reset HEAD <file>
```
Revert to previous commit
```bash
git revert <commitHash>
```
Reset all changes to last commit
```bash
git reset --hard <commit> "eg: HEAD^1 refers to last commit"
```
Reset all changes to last commit without resetting files
```bash
git reset --soft <commit> "eg: HEAD^1 refers to last commit"
```
--hard reverts working tree and files back to original state of specified commit

--soft removes commited or stagged files but does not revert workign tree or files

Push a branch to a remote with a differnt named branch

```git push origin local-name:remote-name```

以上是关于markdown Git作弊表的主要内容,如果未能解决你的问题,请参考以下文章

markdown Pipenv作弊表用于常见命令

markdown Kubernetes的作弊表

markdown MongoDb作弊表

markdown MongoDb作弊表

markdown Mocha,Chai和Sinon的终极单元测试作弊表

markdown Mocha,Chai和Sinon的终极单元测试作弊表