Git Revert Some Changes

Tasks

  1. Access the git repository at /usr/src/kodekloudrepos/beta on the Storage server in Stratos DC.

  2. Identify the current HEAD commit to be reverted.

  3. Revert the HEAD commit to the previous commit with the message "initial commit".

  4. Use git revert HEAD to create a new commit with the message "revert beta".

Steps

1

SSH to the Storage server

ssh natasha@ststor01
2

Get root/sudo access

sudo su -
3

Navigate to the beta repo

cd /usr/src/kodekloudrepos/beta
4

Check recent commits

git log --oneline -2
5

Revert the latest commit

git revert HEAD --no-edit
6

Change the commit message to exactly "revert beta"

git commit --amend -m "revert beta"
7

Verify the commit history

git log --oneline -2

Last updated