Normally, you don't need to remove a branch, you'd use git reset --hard REV to set it to the desired new revision. However, if I understand yuo correctly, you want to reset it to "nothing", i.e. to the state as it was right after git init was first invoked. git doesn't seem to allow you to do that, but you can get a similar effect by simply removing .git/heads/refs/master. Here is a demonstration in a newly created repo:
[~/x]$ git init Initialized empty Git repository in /home/author/x/.git/ [~/x]$ touch a [~/x]$ git add a [~/x]$ git commit -m foo [master (root-commit) 5fcc99c] foo 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 a [~/x]$ git log commit 5fcc99cc396cf5bc2c2fa9edef475b0cc9311ede Author: ... Date: Mon Sep 3 12:40:15 2012 +0200 foo
Here you'd want to do this, but git doesn't allow it:
[~/x]$ git reset --hard HEAD^ fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
However, you can do this instead:
[~/x]$ rm .git/refs/heads/master
Check that it worked by committing something
[~/x]$ touch b [~/x]$ git add b [~/x]$ git commit -m 'new history' [master (root-commit) 0e692b9] new history 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 a create mode 100644 b [~/x]$ git log commit 0e692b9bb77f526642dcdf86889ec15dfda12be0 Author: ... Date: Mon Sep 3 12:40:52 2012 +0200 new history [~/x]$ git branch * master