@Test
public void checkoutPreviousCommitTree() throws Exception {

	RevCommit commit = git.add("file.txt", "a");
	git.add("file.txt", "b");
	Repository repo = git.repo();
	File file = new File(repo.getWorkTree(), "file.txt");
	FileReader reader = new FileReader(file);
	assertEquals('b', (char) reader.read());
	reader.close();
	TreeCheckoutOperation op = new TreeCheckoutOperation(repo, commit);
	ObjectId tree = op.call();
	assertEquals(commit.getTree(), tree);
	reader = new FileReader(file);
	assertEquals('a', (char) reader.read());
	reader.close();
}