Skip to content

Commit

Permalink
feat: Show precaution procedure before doing undo commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyeelok committed Jun 30, 2018
1 parent 94d36a2 commit e13c019
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ Return to master branch and merge changes from <name_of_branch> branch
#### Undo Commits
Be careful with these commands when working on a shared repository -- for example with Github. Resetting commits changes the "history" of the repo -- so only use it to back out of local commits that haven **not** been pushed to a shared repository.

*git branch <name_of_backup_branch>* **Precaution: always create a backup branch before doing any undo commits.**
*git merge <name_of_backup_branch>* **If anything goes wrong during undo commits, you can always roll back to normal using the backup branch.**

```git reset --soft HEAD^``` Undo last commit of entire repo, but leave files staged.

```git reset --hard HEAD^``` Completely blow away last commit. Changes files to state of previous commit.
Expand Down

0 comments on commit e13c019

Please sign in to comment.