Skip to content

Instantly share code, notes, and snippets.

View NirajanMahara's full-sized avatar
🚀
On Mars

Nirajan Mahara NirajanMahara

🚀
On Mars
View GitHub Profile
@NirajanMahara
NirajanMahara / .md
Created July 2, 2021 07:05
Revert the full commit || About History Rewriting || Delete the last commit

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

<h1>Summary of Workshop 5 Step wise process</h1>
1. fork the original repo
2. git clone [https://github.com/NirajanWEB/WorkshopGroup10.git | https of your forked repo]
3. cd WorkshopGroup10
4. git checkout participants
5. Edit Files
6. git status
7. git add -p / git add .
8. git status