How to Quickly Revert Changes in Git
Sometimes you experiment with a new feature and you decide not to use a certain library or an approach. You need to revert back to the previous working version. I was working with flip.js jQuery plugin and decided not to use it. The git status shows the files that were modified.
You can list only the modified files like this:
You can now combine
xargs with this output to revert your changes.
$git ls-files -m | xargs git checkout $git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean
Ace the Technical Interview
- Easily find the gaps in your knowledge
- Get customized lessons based on where you are
- Take consistent action everyday
- Builtin accountability to keep you on track
- You will solve bigger problems over time
- Get the job of your dreams
Take the 30 Day Coding Skills Challenge
Gain confidence to attend the interview