摘要: 基础命令git add . // 会将文件添加到本地暂存区,未生成版本git commit -m 'xx'// 提交后会生成最新版本git checkout '文件名'// 恢复该文件到未修改之前内容git reset HEAD// 只恢复暂存区的内容,如果执行了add,那么执行该命令后会恢复到ad 阅读全文
posted @ 2022-08-17 17:59 一只忙碌的蜗牛 阅读(3707) 评论(0) 推荐(0) 编辑
摘要: 1、已提交,没有push 1)git reset --soft 版本号 : 撤销commit 使用: 查看git log 看到 如下有两次提交: commit 2(版本号) 第二次提交 commit 1(版本号) 第一次提交。 若要撤销第2次提交,恢复到第一次提交,则使用 git reset --s 阅读全文
posted @ 2022-08-17 16:38 一只忙碌的蜗牛 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1. 未使用git add 缓存代码使用git checkout – 文件名,注意中间有–git checkout -- filename git checkout -- filename的作用是把filename文件在工作区的修改撤销到最近一次git add 或 git commit时的内容,具体 阅读全文
posted @ 2022-08-17 13:24 一只忙碌的蜗牛 阅读(163) 评论(0) 推荐(0) 编辑