Git revert can be used to revert a file (change a file) back to a previous state. Git provides us with a powerful mechanism to change the contents of a file back to a previous version. There are many times when someone may accidentally commit a file into the project repository however it is entirely possible to revert a file back to a previous version through some simple commands.
Git Revert Video Tutorial
It is always advised to be careful when committing files into a git repository as you don’t want to spend any time reverting but note that given a mistake is made then we can revert very easily. Also note that we may want to revert due to design or principle changes.