DEV Community

Discussion on: Git Staging Area: Explained Like I'm Five

Collapse
 
crs1138 profile image
Honza

Ok, I get that this opens the box. Now my HEAD is in the box, but how do I recover the one file?

Thread Thread
 
offendingcommit profile image
Jonathan Irvin

Well, depends on what you mean by recover. If you checked out the commit, you'll see the version of the file you want. If there's a lot of changes you can make a copy and then paste it over the latest commit. If there's a few, you can revert lines or hunks selectively.