File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ This Repository is a guide to all the git commands you need to use in case any o
9
9
* [ 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 )
10
10
* [ Short hands] ( #short-hands )
11
11
* [ GitHub CLI commands] ( #github--cli-commands )
12
-
12
+ * [ Reverting Commits : sunglasses : ] ( #reverting-commits-sunglasses )
13
13
14
14
15
15
## Basic Commands :v :
@@ -233,6 +233,16 @@ now, when you add the files it ignores node_modules directory in your project.
233
233
234
234
** [⬆ Back to Index](# index-books)**
235
235
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
+
236
246
# # Short hands
237
247
238
248
` ` ` sh
@@ -328,4 +338,3 @@ Create a shortcut for a gh command.
328
338
` ` `
329
339
330
340
** [⬆ Back to Index](# index-books)**
331
-
You can’t perform that action at this time.
0 commit comments