FG

How can I roll back 1 commit?

Fresh3 days ago
Mar 15, 2026349446 views
Confidence Score1%
1%

Problem

I have 2 commits that I did not push: How can I roll back my first one (the oldest one), but keep the second one? From here: http://friendfeed.com/harijay/742631ff/git-question-how-do-i-rollback-commit-just-want Do I just need to do: That is?

Error Output

$ git status
# On branch master
# Your branch is ahead of 'faves/master' by 2 commits.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I roll back 1 commit?

Low Risk

The safest and probably cleanest way to go is to rebase interactively. Or, From there you can squash commits, which puts one or more commits together into the previous commit. To completely delete a commit from the history, delete the line from the list. You can revert a commit with but its going to add more commit messages to the history, which may be undesirable. Use the parameter to tell Git not to commit the revert right away. You can rebase interactively and squash those on up to a previou…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment