Discarding Chunks / Lines in a File

In this episode, we will learn how to undo only certain changes in a file - down to the level of chunks and even individual lines of code!

Transcript
Discarding Chunks / Lines in a File

In a previous video, I’ve already demonstrated how to restore a modified file. In this video, however, I’ll get a lot more granular - because I’ll show you how to undo only certain parts and even lines in a modified file!

So, let’s say that we’re not happy with all of the changes we’ve made in "imprint.html". You can simply choose to discard either a whole chunk of changes - or even just specific lines of code.

Of course, this is not limited to discarding changes - you can also add them to the staging area in this way. That is a very powerful way to deal with your changes, and ultimately to create really precise commits.