Skip to content

Commit 68147e4

Browse files
authored
Merge pull request #13 from AP-XD/master
ADD the reverting commits method
2 parents 7a7b761 + fdadb66 commit 68147e4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This Repository is a guide to all the git commands you need to use in case any o
99
* [Dev branch is X commits behind and Y commits ahead of master](#your-dev-branch-is-x-commits-behind-and-y-commits-ahead-of-master-fix)
1010
* [Short hands](#short-hands)
1111
* [GitHub CLI commands](#github--cli-commands)
12-
12+
* [Reverting Commits :sunglasses:](#reverting-commits-sunglasses)
1313

1414

1515
## Basic Commands :v:
@@ -233,6 +233,16 @@ now, when you add the files it ignores node_modules directory in your project.
233233
234234
**[⬆ Back to Index](#index-books)**
235235
236+
## Reverting Commits :sunglasses:
237+
These steps are to be followed when you want to revert some unnecessary commits from a specific commit to the latest commit.
238+
```sh
239+
git reset --hard <commit-hash>
240+
sets the HEAD of the current branch point to that specific commit.
241+
git push -f
242+
force pushes the changes to the current branch.
243+
```
244+
**[⬆ Back to Index](#index-books)**
245+
236246
## Short hands
237247
238248
```sh
@@ -328,4 +338,3 @@ Create a shortcut for a gh command.
328338
```
329339
330340
**[⬆ Back to Index](#index-books)**
331-

0 commit comments

Comments
 (0)