Change the length of a line and keep same width?

Solution 1:

On the far right side of the Tool Controls Bar, you'll find four buttons (to the right of the "Affect:" label; see the screenshot below). You can use those to control which aspects of an object are affected by, e.g. resizing operations.

The four "affect" buttons on the Tool Controls Bar

Solution 2:

Select the Edit Paths by Nodes tool and grab one end of the path. You can then move it around. If you're using freehand lines it's a bit more complicated but the principle is the same (you have to move multiple nodes).