鼎鼎知识库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

出现非常混乱的情况,首先本地回滚到某个版本:

git reset xxx --hard

然后让远程也回滚

git push origin master -f

查看最近记录

git log --since=1.days
git log --since=1.weeks
git log -p -2 --oneline

Please commit your changes or stash them before you merge. 场景是不想把本地的一个修改文件提交上去

git stash
git pull 
git stash pop

另外:
git stash list
git stash clear

删除缓存区的内容

正确的做法应该是:

--从暂存区删除:git rm --cached logs/xx.log
--把删除文件放.gitignore文件
--提交变化:git add --all; git commit -m "some changes";