function doRevert(doc) {
        var result = new $.Deferred();
        
        FileUtils.readAsText(doc.file)
            .done(function (text, readTimestamp) {
                doc.refreshText(text, readTimestamp);
                result.resolve();
            })
            .fail(function (error) {
                FileUtils.showFileOpenError(error.code, doc.file.fullPath)
                    .always(function () {
                        result.reject(error);
                    });
            });
        
        return result.promise();
    }
Reverts the Document to the current contents of its file on disk. Discards any unsaved changes
in the Document.
@param {Document} doc
@return {$.Promise} a Promise that's resolved when done, or rejected with a FileError if the
     file cannot be read (after showing an error dialog to the user).