I want to revert all my changes in a repository, so is it possible to delete all commits in Bitbucket? If so, how?
Asked
Active
Viewed 1.5k times
1
-
3Create a new repo (discard old one, if not required). Isn't that sufficient? – sinhayash Apr 20 '14 at 18:15
2 Answers
6
I have no idea why you'd want to do something like this, but..
One way to do it would be to reset to your initial commit:
git reset --hard (find the sha1 of your first commit)
and then force push:
git push -f
You're pretty much rewriting the entire history of whatever branch you're pushing to. Why not just create a new repository?

yamafontes
- 5,552
- 1
- 18
- 18
-
If your initial commit is say for example a 3GB one, you still have that monster in the closet and this does not remove it. – Mark Schultheiss Apr 29 '17 at 04:58
1
git reset --hard <commit>
Read more here: https://www.atlassian.com/git/tutorial/undoing-changes#!reset

sinhayash
- 2,693
- 4
- 19
- 51