Linked Questions

69 votes
1 answer
112k views

How to remove specific commits from Git? [duplicate]

I want to remove few commits from my remote repository. I have few commits like this in my repo: commits messages abcd123 some message xyze456 another commit message 98y65r4 this commit ...
ANIL's user avatar
  • 2,632
2 votes
2 answers
8k views

How do I remove specific commit in my branch [duplicate]

here is my situation. 1) I forked a project from someone else 2) I created a separate branch and edited some files on it 3) I created a Pull Request from that branch and Merged It to Master of mine....
Junwoo HWANG's user avatar
0 votes
1 answer
4k views

is there anyway to delete or remove a git commit by specific commit id [duplicate]

l couldn't find a way to delete a commit and remove it from Github history and git log by specific commit id
KingAziz's user avatar
0 votes
2 answers
530 views

Git: how to remove several commits [duplicate]

At now i have these commits: A -> B -> C -> D -> E -> F How can i remove changes from C to E, and get these: A -> B -> F Thanks.
Anton Vahmin's user avatar
0 votes
1 answer
326 views

How do I remove a previous git commit? [duplicate]

I git committed a large tar file (tens of GB). Oops. I then made a few more commits. I then tried to push to an existing remote repository on github of the simplest form (a single branch and I am the ...
astromonerd's user avatar
251 votes
9 answers
139k views

How do you remove a specific revision in the git history?

Suppose your git history looks like this: 1 2 3 4 5 1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done? Is there an efficient method when there ...
1800 INFORMATION's user avatar
38 votes
8 answers
32k views

Remove earlier commit but keep recent changes

I have some commits in my repository like: A - Added Feature A B - Removed Feature B C - Redesigned Feature C D - Added Feature D E - Added Feature D Where E is the most recent commit I made. Now I ...
Bernd Strehl's user avatar
  • 2,890
28 votes
2 answers
62k views

How to delete commits with egit?

I just made some bad commits with egit that I would like to delete. How do I delete commits from egit? Thanks! EDIT: I tried a hard reset a few times but it didn't do anything. EDIT 2: Hard reset ...
jobukkit's user avatar
  • 2,570
12 votes
2 answers
11k views

Remove a git commit between two commits

I added some functionality in my project which took 4 git commits, now business is asking that the functionality is no more needed(After more than a month). So I need to remove those particular git ...
Niranjan Kumar's user avatar
1 vote
1 answer
2k views

git - Remove multiple commits in between

git log scenario: Commit 1 Commit 2 Commit 3 Commit 4 Commit 5 Commit 6 I need to remove commits 2-4 from between making the final git log as Commit 1 Commit 5 Commit 6 What is the best way ...
adimoh's user avatar
  • 709
4 votes
2 answers
2k views

Use "git revert" to back-out a change adding a line?

The following pastebin is a repo with one file with one, two, three, four, five typed on each line. Each line was commited separately into git: http://pastebin.ca/raw/2136179 I then tried to delete ...
sabgenton's user avatar
  • 1,843
1 vote
1 answer
2k views

How to remove and specific commit from Bitbucket

git rebase -i HEAD~x (x= no. of commits) upon executing notepad file will open 'put' drop besides your commit git push --force-with-lease. When I add drop it says unknown command. Please let me ...
Shiv Kumar's user avatar
1 vote
2 answers
1k views

Git - Unmerge a deleted branch

Scenario: Created a Feature Branch From Master(Blue Color Branch) Made commits to it Later Merged with the Master and Deleted the Branch In between, I have created other Feature Branches and made ...
Harish ST's user avatar
  • 1,473
3 votes
1 answer
587 views

How to squash a commit made in the GitHub website?

I did a little editing in a file on my GitHub repository through the website and then committed the changes. It's not like changing a file, committing and then pushing it to the origin, I did it ...
Bad Programmer's user avatar
-1 votes
1 answer
423 views

Remove or revert a specific commit from a master [duplicate]

Can anyone tell me how can I remove a specific commit from master? This commit is 10 commits down. I mean 10 commits have been pushed after this commit. How many ways can we do it?
Asad Khan's user avatar
  • 491

15 30 50 per page