     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}"

    workspaceElement = atom.views.getView(atom.workspace)
    jasmine.attachToDOM(workspaceElement)
    projectPath = path.join(__dirname, '../fixtures/a')
    atom.project.setPaths([projectPath])
    waitsForPromise ->
      atom.packages.activatePackage('git')

      runs ->
        expect(workspaceElement.querySelector('.unstaged.files').innerHTML).toContain('foo.md')

  describe 'keyboard navigation', ->
    it 'focuses a hunk when the status list is focused and the right arrow key is pressed', ->
      makeChange()
      dispatchCommand()
