我不小心将错误的文件提交给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次提交和更改未提交的提交.我怎样才能做到这一点?