     Reset = Git.Reset
     repository = null
 
-    Git.Repository.open(projectPath).then (repo) ->
-      repository = repo
-      repo.head()
-    .then (reference) ->
-      repository.getBranchCommit(reference.toString())
-    .then (commit) ->
-      Reset.reset(repository, commit, Reset.TYPE.HARD)
+    waitsForPromise ->
+      Git.Repository.open(projectPath).then (repo) ->
+        repository = repo
+        repo.getMasterCommit()
+      .then (commit) ->
+        Reset.reset(repository, commit, Reset.TYPE.HARD)
+      .then ->
+        repository.getStatus()
+      .then (statuses) ->
+        for status in statuses
+          fs.unlinkSync(path.join(projectPath, status.path())) if status.isNew()
+      .then ->
+        fs.renameSync(path.join(projectPath, '.git'), path.join(projectPath, '.renamedgit'))
 
   dispatchCommand = (command='view-and-commit-changes') ->
     commandText = "git:#{command}"

        statusList.focus()

      waitsFor 'the highlight to be applied', ->
        $(workspaceElement).find('git-file-summary-element.selected').length > 0

      runs ->
        atom.commands.dispatch(statusList, 'core:move-right')


      runs ->
        diffView = document.querySelector('git-diff-view')
        diffView.focus()
        atom.commands.dispatch(diffView, 'core:move-left')

      waitsFor 'the status list view to be focused', ->
        $('git-status-list-view:focus').length > 0

      runs ->
        expect($('git-status-list-view:focus').length).toBe(1)
