xxxxxxxxxx
you could look at the output of git log,
find the commit id of the commit you want to back up to, and then do this:
git reset --hard <sha1-commit-id>
If you already pushed it, you will need to do a force push to get rid of it
git push origin HEAD --force
xxxxxxxxxx
git checkout master
git reset --hard e3f1e37
git push --force origin master
# Then to prove it (it won't print any diff)
git diff master..origin/master
xxxxxxxxxx
# Step 1: Identify the commit you want to remove
git log
# Step 2: Start an interactive rebase and mark the commit to be removed
git rebase -i HEAD~n
# Replace 'n' with the number of commits from the present branch head to the commit you want to remove.
# Step 3: In the interactive editor, delete the line corresponding to the commit you want to remove.
# Step 4: Save and exit the editor.
# Step 5: Force push the updated branch to the remote repository
git push origin <branch-name> --force