Git and Github part -4

2 min readOct 2, 2023


last part of git series

Topics covered →

  1. what is git revert
  2. tags in git
  3. what is github clone

What is Git revert →

The revert command helps you to undo an existing commit means if commit the files which you do not want to be committed then you are able to revert the changes of commited files back in to stashing area by git revert command

It does not delete any data in this process instead rather git creates a new commit with the included files reverted to their previous state so your version control history moves forward while the file moves backward

Reset → before commit

Revert → After commit

Commands →

  1. git revert <commmit_id>

How to remove Untracked files

  1. git clean -n # Dry run to see which files will be deleted
  2. git clean -f # Actually remove the untracked files (use with caution)

Tags in git →

Tag operation allows to give a meaningful names to a specific version in the repository

To apply a tag

  1. git tag -a <tagname> -m <messgae> <commit_id>
  2. git tag → to see the list of tag
  3. git show <tag name> → to see a particular commit content by using tag
  4. git tag -d <tagname> → to delete a tag

Github Clone →

It is basically used to copy the whole repository of someone into your machine

  1. open github website
  2. login and chose exsiting repo
  3. copy the https url
  4. now go to your linux machine and run command

git clone <url of github repo>

It creates a local repo automatically in linux with the same name as in github account




Cloud computing and DevOps Engineer and to be as a fresher I am learning and gaining experiance by doing some hands on projects on DevOps and in AWS OR GCP