100-Days-Of-DevOps-Challenge-KodeKloud

Git Revert Some Changes

The Nautilus application development team was working on a git repository /usr/src/kodekloudrepos/demo present on Storage server in Stratos DC. However, they reported an issue with the recent commits being pushed to this repo. They have asked the DevOps team to revert repo HEAD to last commit. Below are more details about the task:

Steps

  1. Login into storage server
  2. Move into repository directory

     sudo su
     cd /usr/src/kodekloudrepos/demo
    
  3. Check git log to find initial commit

     git log --oneline
    

    if you find initial commit message, then copy commit hash and run the following command

     git revert HEAD -m "revert demo"
    
  4. Push the changes

     git push
    

Good to Know?

Git Revert vs Reset

Revert Operations

Commit Messages

Safety Considerations