After being a freelance web developer for 12 years, I got a fulltime gig at Leadtech, Barcelona as a front-end developer. I'm the advocate of switching to Gutenberg blocks on our current WP web sites.
How do I open one of the many sealed boxes find some old code and bring it back to life?
Let's say, I deleted a bunch of files in favour of one that does what all these other files were doing. That was 3 or commits ago. Now, I just remembered that one of the files would be useful to me.
After being a freelance web developer for 12 years, I got a fulltime gig at Leadtech, Barcelona as a front-end developer. I'm the advocate of switching to Gutenberg blocks on our current WP web sites.
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
How do I open one of the many sealed boxes find some old code and bring it back to life?
Let's say, I deleted a bunch of files in favour of one that does what all these other files were doing. That was 3 or commits ago. Now, I just remembered that one of the files would be useful to me.
Git checkout
Ok, I get that this opens the box. Now my HEAD is in the box, but how do I recover the one file?
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.