git 笔记 1

//配置git参数
git config user.name "you name"
git config user.email "you email"

//初始化
git init

//添加文件
git add  readme.txt

//  查看状态
git status

//查看修改
git diff [文件名]

//提交
git commit -m "提交注释"

//查看日志
git log

//查看操作日志
git reflog

//回滚 到上一版本
git reset --hard HEAD ^

//回滚到特定版本
git reset --hard  + 版本id(git log 后的commit编号)

参考: 廖雪峰老师的博客

原文地址:https://www.cnblogs.com/ElvinLong/p/4757829.html