Skip to content

Instantly share code, notes, and snippets.

View ousid's full-sized avatar
Building Livewire Toolkit

Oussama ousid

Building Livewire Toolkit
View GitHub Profile
ousid /
Created October 20, 2022 15:42 — forked from gunjanpatel/
Git HowTo: revert a commit already pushed to a remote repository

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:

ousid / _virtual-select.scss
Last active November 14, 2021 14:21
Laravel Searchable Dropdown Component
View _virtual-select.scss
// custom style using sass & tailwindcss
.vscomp-ele {
max-width: 100% !important;
.vscomp-toggle-button {
@apply mt-1 border-gray-300 transition block w-full duration-150 rounded-md shadow-inner bg-gray-100 py-3;
&:focus {
@apply border border-info ring-info ring-opacity-25;
ousid / UsersComponent.php
Last active April 19, 2022 15:35
Livewire Example Using Virtual Select (Alternative to Select2)
View UsersComponent.php
// ....
/** @var array */
public $selectedUsers;
public function create()
// selectedUsers returns an array of ids.
ousid / app.scss
Last active October 9, 2020 18:29
View app.scss
@import url(';300;400;600;700;900&display=swap');
@import './switch';
@tailwind base;
:root {
color-scheme: light dark;