<PAGE>   1


                                                                  EXHIBIT 10.40

            SIXTH AMENDMENT TO AMENDED AND RESTATED CREDIT AGREEMENT


                  THIS SIXTH AMENDMENT TO AMENDED AND RESTATED CREDIT AGREEMENT
(this "Amendment") is dated as of December 10, 1998 among: HS RESOURCES, INC., a
corporation formed under the laws of the State of Delaware (the "Borrower");
each of the lenders that is a signatory hereto; and THE CHASE MANHATTAN BANK (in
its individual capacity, "Chase"), as agent for the Lenders (in such capacity,
together with its successors in such capacity, the "Agent").

                                 R E C I T A L S

         A. The Borrower, the Agent, and the Lenders (as defined in the Credit
Agreement as hereafter defined) have entered into that certain Amended and
Restated Credit Agreement dated as of June 14, 1996, as amended by the First
Amendment to Amended and Restated Credit Agreement dated as of June 17, 1996,
the Second Amendment to Amended and Restated Credit Agreement dated as of
November 27, 1996, the Third Amendment to Amended and Restated Credit Agreement
dated as of December 15, 1997, the Fourth Amendment to Amended and Restated
Credit Agreement dated as of June 16, 1998 and the Fifth Amendment to Amended
and Restated Credit Agreement dated as of September 1, 1998 (as amended, the
"Credit Agreement"), pursuant to which the Lenders have agreed to make certain
loans and extensions of credit to the Borrower upon the terms and conditions as
provided therein; and

         B. The Borrower, the Agent, and the Lenders now desire to make certain
amendments to the Credit Agreement.

         NOW, THEREFORE, in consideration of the premises and other good and
valuable consideration and the mutual benefits, covenants and agreements herein
expressed, the parties hereto now agree as follows:

         1. All capitalized terms used in this Amendment and not otherwise
defined herein shall have the meanings ascribed to such terms in the Credit
Agreement.

         2. The definitions "Indentures," "Subordinated Debt," and "Subordinated
Notes" in Section 1.02 of the Credit Agreement are hereby amended to read as
follows:

                  "Indentures" shall mean the 93 Indenture, the 96 Indenture 
         and the 98 Indenture.

                  "Subordinated Debt" shall mean the Debt of the Company
         evidenced by the Subordinated Notes or the Indentures.


<PAGE>   2

                  "Subordinated  Notes" shall mean the 93 Subordinated  Notes, 
         the 96 Subordinated  Notes and the 98 Subordinated Notes.

         3. Section 1.02 of the Credit Agreement is hereby supplemented, where
alphabetically appropriate, with the addition of the following definitions:

                  "98 Indenture" shall mean the Indenture between the Borrower,
         as Issuer, and Harris Trust and Savings Bank, as Trustee, providing for
         the issuance of $85,000,000 of Senior Subordinated Notes due November
         15, 2006 and all renewals, extensions and modifications permitted by
         the terms of this Agreement.

                  "98 Subordinated Notes" shall mean the Senior Subordinated
         Notes issued pursuant to the 98 Indenture.

                  "Sixth Amendment" shall mean that certain Sixth Amendment to
         Amended and Restated Credit Agreement dated as of December 10, 1998,
         among the Borrower, the Lenders and the Agent.

                  "Sixth Amendment Effective Date" shall mean the effective date
         of the Sixth Amendment and shall be the same date as the effective date
         of the 98 Indenture; provided, that the conditions required by Section
         14 of the Sixth Amendment have been satisfied.

                  "Year 2000 Problem" shall mean the risk that the computer
         hardware or software applications or other data processing capacities
         used by the parties may be unable to recognize and perform properly
         date-sensitive functions involving certain dates before and any date
         after December 31, 1999."

         4.       During the period from and after the Sixth Amendment Effective
Date until the first Redetermination Date thereafter, the amount of the 
Borrowing Base shall be $280,000,000.

         5.       Section 2.08(e) of the Credit Agreement is hereby amended to 
read as follows:

                  "(e) The Agent shall promptly notify in writing the Borrower
         and the Lenders of the Borrowing Base set by the Super Majority
         Lenders. If the amount of the proposed Borrowing Base is a decrease
         from the amount of the previous Borrowing Base, it shall become
         effective upon receipt of written notice by the Borrower. If the amount
         of the proposed Borrowing Base is an increase of the amount of the
         previous Borrowing Base, within five (5) Business Days of the receipt
         of such written notice, any Lender that had in writing disagreed to
         such increase (each a "Dissenting Lender") shall send written notice to
         the Agent stating that either (i) it agrees that its Commitment shall
         be calculated by its current Percentage Share of the proposed Borrowing
         Base or (ii) it agrees to be bound by some lesser Commitment
         ("Dissenting Lender's Reduced Prorata Borrowing Base"), but in no event
         less than the amount of its Commitment in 



                                      -2-
<PAGE>   3


         effect before the effectiveness of the proposed Borrowing Base. If the
         Agent does not receive a written notice from a Dissenting Lender in
         which it makes the above election within the five Business Day period,
         the absence of such notice shall be deemed to be an election by such
         Dissenting Lender of option (i) above. If any Dissenting Lender timely
         elects option (ii) above, the Agent will calculate the resulting
         Borrowing Base which will equal (y) the proposed Borrowing Base minus
         (z) the sum, for each Dissenting Lender that timely elected option
         (ii), of the differences of (A) the product of (1) each such Dissenting
         Lender's current Percentage Share times (2) the proposed Borrowing Base
         minus (B) such Dissenting Lender's Reduced Prorata Borrowing Base. The
         Agent will calculate the new Percentage Share for each Lender based on
         each Lender's prorata share of the new Borrowing Base. The Agent will
         also calculate the Aggregate Maximum Credit Amounts for all the Lenders
         and the Maximum Credit Amount for each Lender. The Maximum Credit
         Amount for each Dissenting Lender that elected option (ii) shall
         reduce, the Maximum Credit Amount for each of the other Lenders shall
         remain the same and the Aggregate Maximum Credit Amount shall reduce.
         The Borrower will issue a new Note to each Dissenting Lender that
         elected option (ii) in the amount of such Lender's new Maximum Credit
         Amount to replace the outstanding Note held by such Lender.

         6.       Section 7 of the Credit Agreement is hereby supplemented with
the addition of the following Section 7.23:

                  "7.23 Year 2000 Provision. Any reprogramming or other
         correcting required to permit the proper functioning, in and following
         the year 2000, of the Borrower's computer systems necessary to permit
         the Borrower to conduct its business without a Material Adverse Effect
         (including systems and equipment supplied by others) and the testing of
         all such systems and equipment, as so reprogrammed, will be completed
         by June 30, 1999. Borrower reasonably expects to be able to identify
         and remedy Year 2000 Problems associated with its equipment containing
         embedded microchips on or before June 30, 1999. The cost to the
         Borrower of such reprogramming or other remedying and testing of the
         reasonably foreseeable consequences of the Year 2000 Problem to the
         Borrower (including, without limitation, reprogramming errors and the
         failure of others' systems or equipment) will not to Borrower's
         knowledge result in a Default or Material Adverse Effect. Except for
         such of the reprogramming referred to in the first sentence of this
         Section 7.23 as may be necessary, the computer and management
         information systems of the Borrower and its Subsidiaries are and, with
         ordinary course upgrading and maintenance, will continue to be,
         sufficient to permit the Borrower to conduct its business without
         Material Adverse Effect."

         7.       Section 8.01(i) of the Credit Agreement is hereby amended to 
read as follows:

                  "(i) At each time of delivery of the financial statements
         required to be delivered pursuant to Sections 8.01(a) and (b) a report
         in form and substance satisfactory to the Agent setting forth the use
         of proceeds from asset sales and 



                                      -3-
<PAGE>   4


         demonstrating compliance with Sections 4.03(b)(i) of the 96 Indenture
         and of the 98 Indenture."

         8.       Section 8.01 of the Credit Agreement is hereby amended by 
adding the following sentence at the end of such section:

         "The above compliance certificate will include a statement that the
         Year 2000 remediation efforts of the Borrower and the Subsidiaries are
         proceeding as scheduled and indicating whether an auditor, regulator,
         or third party consultant has issued a management letter or other
         communication regarding the Year 2000 exposure, program, or progress of
         the Borrower and/or the Subsidiaries."

         9.       Section 9.01(g) of the Credit Agreement is hereby amended to 
read in its entirety as follows:

                  "(g) the Subordinated Debt not to exceed at any time
         $75,000,000 of principal outstanding under the 93 Subordinated Notes,
         $150,000,000 of principal outstanding under the 96 Subordinated Notes
         and $85,000,000 of principal outstanding under the 98 Subordinated
         Notes;"

         10.      Section 9.01(o) of the Credit Agreement is hereby amended to 
read as follows:

         "(o)     other Debt of the Borrower not to exceed $5,000,000 
         outstanding  at any time in the aggregate."

         11.      Section 9.04(a) of the Credit Agreement is amended to read as
follows:

         "(a)     redeem shares from its stockholders not to exceed $10,000,000
         in the aggregate since the Closing Date; and"

         12.      The first sentence of Section 9.14 of the Credit Agreement is
amended to read as follows:

         "The Borrower will not permit its Interest Coverage Ratio as of the end
         of any fiscal quarter of the Borrower (calculated quarterly at the end
         of each fiscal quarter) to be less than 2.30 to 1.00 through the
         quarter ending December 31, 1999, 2.50 to 1.00 thereafter through the
         quarter ending December 31, 2000 and 2.75 to 1.00 thereafter."

         13. Section 9.15(iv) of the Credit Agreement is hereby amended to read
as follows:

         "(iv) during the period between two consecutive Redetermination Dates,
         sales in the ordinary course of business of Oil and Gas Properties
         which shall not exceed $10,000,000 in the aggregate including, but not
         limited to, the sale of the Hydrocarbon Interests representing
         approximately the final 20% of the gas reserves in a Section 29 tax
         credit transaction as the values are set forth in the most recent
         Reserve Report."


                                      -4-
<PAGE>   5



         14. Section 9.20 of the Credit Agreement is amended by adding the
following subsection (c):

         "(c) The Borrower will not modify or amend the terms of the 98
         Indenture as in existence on Sixth Amendment Effective Date and any
         related documents without the consent of the Majority Lenders, if the
         effect of such modification or amendment would be to shorten the time
         for payment on any 98 Subordinated Notes, increase the principal amount
         of the 98 Subordinated Notes above $85,000,000, increase the rate of
         interest on any 98 Subordinated Note or change the method of
         calculating interest so as to effectively increase the rate of interest
         on any 98 Subordinated Note, change the form of the reverse side of the
         Security issued under the 98 Indenture, change any of the provisions of
         Section 6.01, Articles 3,4,5,10,11 and 12, and Section 1.01 as to any
         of the definitions used in or relating to any of the above Sections and
         Articles, or any other provisions which would detrimentally effect the
         rights of the Lenders. The Indebtedness shall first be irrevocably and
         indefeasibly paid in full in cash, or the immediate payment thereof
         duly provided for in cash, and this Agreement terminated before the
         Borrower, any Subsidiary or any Person acting on behalf of the Borrower
         or any Subsidiary shall directly or indirectly pay, prepay, redeem,
         retire, repurchase or otherwise acquire for value, or make a deposit
         pursuant to Article 8 of the 98 Indenture in respect of, or make any
         other prepayment, payment or distribution (whether in cash, property,
         securities or accommodation thereof or otherwise) on account of the
         principal of (or premium, if any) or interest on, any 98 Subordinated
         Note or Subsidiary Subordinated Debt related thereto; except that the
         Borrower may make payments of interest that has accrued and is payable
         on the 98 Subordinated Notes pursuant to the terms of the 98 Indenture
         and pay the principal of the 98 Subordinated Notes at the stated
         maturity of November 15, 2006 provided that no Event of Default exists
         and is continuing and such payment shall not cause an Event of
         Default."

         15. Annex I of the Credit Agreement is hereby replaced by Annex I to
this Amendment.

         16. As set forth in the compliance certificate delivered by the
Borrower in connection with the delivery of the Borrower's September 30, 1998
quarterly financial statements, the Borrower excluded commitment fees paid from
cash interest payments and rounded the Interest Coverage Ratio to the nearest
1/100th. The Lenders hereby agree that the rounding to the nearest 1/100th and
the exclusion of commitment frees from cash interest payments were acceptable
for such calculation of the Interest Coverage Ratio for the quarter ending
September 30, 1998 and any quarters before. For future calculations of the
Interest Coverage Ratio the parties hereto agree that commitment fees paid shall
be included in cash interest payments and all numbers will be rounded downward
to the nearest 1/100th.

         17. This Amendment shall become binding on the Lenders when, and only
when, the 



                                      -5-
<PAGE>   6


following conditions shall have been satisfied and the Agent shall have received
each of the following, as applicable, in form and substance satisfactory to the
Agent or its counsel:

                  (a) counterparts of this Amendment executed by the Borrower 
         and the Super Majority Lenders;

                  (b) a copy of the 98 Indenture;

                  (c) the issuance of the 98 Subordinated Notes for the 
         principal amount of $85,000,000;

                  (d) the fee payable to each Lender which consent to this
         Amendment equal to the greater of $5,000 or an amount equal to 0.1% of
         such Lender's Percentage Share of the new Borrowing Base; and

                  (e) such other documents as it or its counsel may reasonably
         request.

         18. The parties hereto hereby acknowledge and agree that, except as
specifically supplemented and amended, changed or modified hereby, the Credit
Agreement shall remain in full force and effect in accordance with its terms.

         19. The Borrower hereby reaffirms that as of the date of this
Amendment, the representations and warranties contained in Article VII of the
Credit Agreement are true and correct on the date hereof as though made on and
as of the date of this Amendment, except as such representations and warranties
are expressly limited to an earlier date.

         20. THIS AMENDMENT (INCLUDING, BUT NOT LIMITED TO, THE VALIDITY AND
ENFORCEABILITY HEREOF) SHALL BE GOVERNED BY, AND CONSTRUED IN ACCORDANCE WITH,
THE LAWS OF THE STATE OF NEW YORK.

         21. This Amendment may be executed in two or more counterparts, and it
shall not be necessary that the signatures of all parties hereto be contained on
any one counterpart hereof; each counterpart shall be deemed an original, but
all of which together shall constitute one and the same instrument. Delivery of
an executed signature page of this Amendment by facsimile transmission shall be
effective as delivery of a manually executed counterpart hereof.

         IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be
executed as of the date set forth in the opening paragraph of this Amendment..



                              [SIGNATURES OMITTED]

                                      -6-