相关疑难解决方法(0)

如何撤消Git中最近的提交?

我不小心将错误的文件提交给Git,但我还没有将提交推送到服务器.

如何从本地存储库中撤消这些提交?

git version-control undo pre-commit git-commit

2万
推荐指数
103
解决办法
826万
查看次数

撤消git中几个没有推送到远程的提交

我已经运行了git status

# On branch master
# Your branch is ahead of 'origin/master' by 4 commits.
#   (use "git push" to publish your local commits)
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   app/views/layouts/_header.html.erb
#
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)

我希望在提交到我的远程存储库之前撤消所有4次提交和更改未提交的提交.我怎样才能做到这一点?

git github

25
推荐指数
2
解决办法
2万
查看次数

标签 统计

git ×2

git-commit ×1

github ×1

pre-commit ×1

undo ×1

version-control ×1