To remove the last two commits locally I’d suggest using:
git reset --hard HEAD^^
Rebase is a completely different operation that won’t help you here.
More Related Contents:
- Why Git is not allowing me to commit even after configuration?
- Git: Merge a Commit into a different Branch
- Editing the git commit message in GitHub
- Add commits before root commit in Git? [duplicate]
- After $git push -u origin main command, Git bash is not requesting any authentication literally does nothing
- Pushing to Git returning Error Code 403 fatal: HTTP request failed
- Git push existing repo to a new and different remote repo server?
- How can I revert multiple Git commits?
- Start a Git commit message with a hashmark (#)
- Can’t push to GitHub because of large file which I already deleted
- .gitignore after commit [duplicate]
- Message “Support for password authentication was removed. Please use a personal access token instead.”
- Git: How to ignore fast forward and revert origin [branch] to earlier commit?
- Difference between Git and GitHub
- Authenticate Jenkins CI for Github private repository
- How to git fetch efficiently from a shallow clone
- How can I fork my own GitHub repository?
- git diff between cloned and original remote repository
- How to link to a specific line number on GitHub
- Jenkins linking to my local git repository
- Pull request vs Merge request
- GitHub – List commits by author
- How do I fix “remote: fatal error in commit_refs” errors trying to push with Git?
- GIT commit as different user without email / or only email
- How to push changes to github after jenkins build completes?
- Git: How to make outer repository and embedded repository work as common/standalone repository?
- Git push error: RPC failed; result=56, HTTP code = 200 fatal: The remote end hung up unexpectedly fatal
- Clone only the .git directory of a git repo
- How to push different local Git branches to Heroku/master
- when you have secret key in your project, how can pushing to GitHub be possible?