I have pushed some files by mistake and it shows different heads in main repository. How can I delete that head?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think that you actually want to delete the heads. If you do that, you will lose the work that was done in those branches.
You probably want to merge the heads back into one branch.
Say that you have a tree like this:
To get rid of the additional head without losing the work contained within it you would merge the two heads (revisions 2 and 4 in this example) like this:
That will create another commit which has all the changes in revisions 2, 3 and 4 in a single head like this:
This is standard procedure when multiple developers work on the same repository.