Optimizing PgBench for CockroachDB Part 3

Previous Articles

Previous articles on PgBench and CockoachDB:


Motivation

For the longest time, CockroachDB only supported serializable isolation. In our next release after 23.1, CockroachDB will additionally support read committed isolation. The idea here is that users from other RDBMS tend to face many challenges with application migrations due to the excessive contention stemming from serializable isolation. To ease the migration woes, read committed isolation will provide an easy on-ramp for those applications. Since read-committed isolation is less strict, it has the additional benefit of being more performant at the cost of data anomalies. Today, we're going to take everything we've learned so far in my series and apply it to read committed isolation.

Harmonizing Space, Time, and Semantics: Navigating the Complexity of Geo-Distributed IoT Databases

In the era of the Internet of Things (IoT), the continuous influx of spatial and temporal data from interconnected devices has given rise to a vast and intricate landscape, demanding a sophisticated approach to database management. As we delve into the intricacies of this digital proliferation, the optimization of Geo-Distributed IoT database systems takes center stage. Our focus here is on the meticulous art of spatial-temporal fusion techniques, which play a crucial role in advanced and nuanced query processing.

The Crucial Role of Spatial-Temporal Fusion

At the heart of managing the data deluge lies the intricate dance of space and time within IoT data. Spatial information captures the physical location of devices, while temporal data sequences events in chronological order. The seamless integration of these two dimensions, known as spatial-temporal fusion, becomes a linchpin for enhancing the contextual understanding of data and unlocking the potential for sophisticated query processing.

17 Best WordPress Mailchimp Plugins for 2023

Do you want to integrate Mailchimp with your WordPress site and want to find the best plugins?

Mailchimp is a popular email marketing service that lets you create email campaigns, send automated messages, and more. With the right plugin, you can grow your email list, automate workflows, and make the most out of the service.

In this article, we’ll show you the best WordPress Mailchimp plugins that you can use for your business.

Best WordPress Mailchimp plugins

Why Use WordPress Mailchimp Plugins?

If you’re just getting started with email marketing, then you must have come across Mailchimp. It is one of the best email marketing services in the market. The best part is that you can get started for free and send up to 1,000 emails every month.

With Mailchimp, you can set up emails, create campaigns, and manage your subscribers with ease. It also integrates with other third-party plugins and tools for WordPress.

For instance, you can use it with lead generation software to grow your email list. Or you can connect it with a WordPress contact form plugin and automatically collect email addresses in Mailchimp.

You can even set up automation with Mailchimp using the right plugin. For example, automatically send an email using Mailchimp when publishing a new blog post. This way, your audience is immediately notified about new content, news, announcements, and sales.

That said, let’s look at some of the best Mailchimp plugins you can choose for your business.

1. WPForms

Is WPForms the best form builder plugin for WordPress?

WPForms is the best WordPress form builder plugin for WordPress that lets you easily create Mailchimp signup form with its powerful drag-and-drop form builder.

With its Mailchimp addon, you can create a newsletter signup form and select which audience or group the subscribers should be added to in Mailchimp. This makes it very easy to save form entries and add them to your email list.

Besides that, you also get options to unsubscribe, archive, delete, and record events. The Mailchimp addon also lets you mark subscribers as VIPs, so you know your high-value customers.

By integrating Mailchimp with WPForms, you can assign Mailchimp tags to segment subscribers. Or use WPForms smart tags to save additional information about subscribers in their Mailchimp profiles.

Pros:

  • Beginner-friendly plugin with drag-and-drop builder
  • Tons of pre-built form templates
  • Smart conditional logic
  • Easily integrates with Mailchimp
  • Built-in spam protection
  • Automated workflows

Cons:

  • Offers a Lite version, which is available for free but with limited features
  • Mailchimp integration is not available in the Lite version, only Constant Contact

Why Use This Plugin: If you’re looking to create different WordPress forms and want to collect subscribers’ contact information in Mailchimp, then WPForms is the best plugin.

Pricing: WPForms pricing plans start from $49.50 per year. However, you’ll need the Plus plan to use the Mailchimp addon, which will cost $99.50 per year. There is also a WPForms Lite version you can use for free.

2. Uncanny Automator

Uncanny Automator

Uncanny Automator is the best WordPress automation plugin. You can think of it as Zapier but for WordPress. Uncanny Automator offers different recipes that you can create for Mailchimp and automate workflows.

You can choose from hundreds of actions and triggers to create an automated recipe. It helps 2 or more WordPress plugins to talk to each other.

For example, let’s say a user cancels their membership on MemberPress. They’re then automatically unsubscribed from the Mailchimp audience. Similarly, if a user completes an online course on LifterLMS, then a tag is automatically added to the user’s profile in Mailchimp.

Aside from Mailchimp, Uncanny Automator integrates with over 130 different plugins and social media apps. Plus, its recipe builder is user-friendly, and you don’t need to edit code to set up automation.

Pros:

  • Easy-to-use recipe builder
  • Supports over 130 integrations, including Mailchimp
  • Choose from over 500 triggers and 300 actions
  • Automate workflows without touching code

Cons:

  • The premium version can be a bit expensive for startups or businesses on a tight budget

Why Use This Plugin: If you’re looking for a way to automate your workflows between Mailchimp and other plugins on your WordPress site, then Uncanny Automator is the perfect solution for you.

Pricing: Uncanny Automator prices start from $149 per year.

3. WP WooCommerce Mailchimp

WP WooCommerce MailChimp

WP WooCommerce Mailchimp is a free WordPress Mailchimp plugin. It helps you add customers to your email list automatically.

You can select which Mailchimp list the subscribers should be added to. The plugin lets you choose when to collect customers’ email addresses. For instance, you can collect information when a customer places an order, the order is processed, or when the order is completed.

Other options offered by the plugin include asking permission from customers to subscribe to the email list, editing the opt-in field text, and more.

Pros:

  • Simply and free-to-use plugin
  • Automatically add customers to your email list in Mailchimp
  • Add interest groups to further segment customers
  • Multiple opt-in settings

Cons:

  • Limited opt-in customization options

Why Use This Plugin: If you have a WooCommerce store, then the WP WooCommerce Mailchimp plugin is a great plugin to automatically add customers to specific email lists. This way, you can create custom email campaigns for each customer group and send personalized messages.

Pricing: WP WooCommerce Mailchimp is a free WordPress plugin.

4. OptinMonster

The OptinMonster conversion optimization plugin

OptinMonster is the best lead generation and conversion optimization software. It helps you get more leads, grow your email list, and boost conversions.

OptinMonster easily integrates with Mailchimp, and you can gather email addresses through different campaigns in your Mailchimp account.

With OptinMonster, you can create all types of campaigns, like a simple popup, floating bar, full-screen welcome mats, and more. There are lots of pre-built campaign templates to choose from. You can then use its drag-and-drop campaign builder to easily customize your campaigns.

Plus, it offers powerful display rules that let you show personalized messages based on user behavior. You can learn more by following our ultimate guide to using Mailchimp and WordPress.

For instance, you can show a campaign when a user is about to leave your site with an exit-intent popup. Or display campaigns based on the time a user spends on a page, visit a specific page, and more.

Pros:

  • Drag and drop campaign builder
  • Pre-built campaign templates and customization options
  • Powerful display rules to show campaigns
  • Simple integration with Mailchimp and other email marketing services
  • Mobile friendly popups

Cons:

  • The free version has limited features

Why Use This Plugin: OptinMonster and Mailchimp are an explosive combination to have on your website. It’s perfect for anyone who wants to create attractive and nonintrusive popup campaigns using OptinMonster and collect email addresses in Mailchimp.

Pricing: OptinMonster pricing plans start from $9 per month (billed annually).

5. MC4WP: Mailchimp for WordPress

MC4WP

MC4WP: Mailchimp for WordPress is a free plugin that lets you add signup forms to your WordPress site. It easily integrates with Mailchimp and collects email addresses from the sign-up form.

The plugin is simple and easy to use. It even integrates with other form builders and plugins like WooCommerce, WPForms, AffiliateWP, and more.

While the plugin is free to use, it doesn’t offer the customization options or form templates that you’d get in other form plugins, like WPForms. There are only a handful of form fields to choose from and limited customization options.

Pros:

  • Simple interface and is easy to use
  • Easily integrates with Mailchimp
  • Free to use
  • It also integrates with other form plugins

Cons:

  • Limited customization options
  • No form templates

Why Use This Plugin: The plugin is best for anyone who wants a free WordPress plugin that creates basic sign-up forms and integrates with Mailchimp.

Pricing: MC4WP: Mailchimp for WordPress is a free to use plugin.

6. SeedProd

SeedProd WordPress Website Builder

SeedProd is the best WordPress website builder that helps you create custom themes and landing pages without editing code or hiring a developer.

SeedProd easily integrates with Mailchimp. This way, you can create custom landing pages with subscription forms and collect email addresses in Mailchimp.

Besides that, you can also select which segment or group to add your subscribers to in Mailchimp, enable double opt-in, and more.

Other features offered by SeedProd include a drag-and-drop theme builder, pre-built theme and landing page templates, lots of customization options, and more.

Pros:

  • Super easy to use
  • Drag and drop theme and landing page builder
  • Easily integrates with Mailchimp
  • Multiple customization options

Cons:

  • The free version has limited customization options

Why Use This Plugin: If you’re looking for a plugin that lets you design and create custom landing pages and works seamlessly with Mailchimp, then SeedProd is the perfect solution.

Pricing: You’ll need at least the Plus plan in SeedProd to use Mailchimp integration. This will cost you $99.50 per year.

7. Another Mailchimp Widget

Another MailChimp widget

Another Mailchimp Widget is the next Mailchimp WordPress plugin on our list. The plugin lets you add clean and basic sign-up forms for your WordPress site.

You can show the signup form through a shortcode or use a widget. The plugin also shows different lists from your Mailchimp account. You can select a list and group to add new subscribers.

That said, there are not many customization options or templates to choose from. The plugin just lets you edit the first and last name labels and show a success message and a failure message. The form also only contains 3 fields, which include first name, last name, and email.

Pros:

  • Lightweight and easy-to-use plugin
  • Automatically add subscribers to lists and groups in Mailchimp
  • Add sign-up form using shortcode
  • Free to use

Cons:

  • Limited customization options
  • Cannot add additional form fields

Why Use This Plugin: The plugin is best for anyone looking for a free option to add simple Mailchimp signup forms. It is lightweight, and you can add the form anywhere using a shortcode.

Pricing: Another Mailchimp Widget is 100% free to use.

8. Thrive Themes

ThriveThemes

Thrive Themes offers powerful tools to build high-converting WordPress sites without editing code. It is a complete suite of plugins that help you build, convert, sell, and engage.

Thrive Themes suite includes popular tools like Thrive Leads, Thrive Architect, Thrive Theme Builder, Thrive Quiz Builder, Thrive Ovation, and more.

You can easily integrate Mailchimp with Thrive Theme and then use the email marketing software with different tools in the suite.

For instance, you can connect Mailchimp’s API with Thrive Themes and then use Thrive Leads to gather email addresses. Or use Thrive Apprentice to build online courses and integrate it with Mailchimp for all your email needs.

Pros:

  • Offers 9 powerful tools for different purposes
  • Easy to set up and use
  • Mailchimp easily integrates with different tools
  • 24/7 customer support

Cons:

  • Thrive Theme suite is only for WordPress

Why Use This Plugin: The plugin is great for anyone looking for a complete marketing toolkit for their WordPress site and wants to integrate Mailchimp as well. You can do so much with Thrive Themes tools, from creating landing pages to building online courses, popups, quizzes, and more.

Pricing: The Thrive Themes suite will cost $299 per year.

9. MemberPress

The MemberPress membership plugin

MemberPress is the best WordPress membership plugin that’s beginner-friendly to use. You can use it to create a membership site, lock content based on user roles, set up content dripping, sell online courses, and more.

MemeberPress easily integrates with different email marketing tools, including Mailchimp. This allows you to add your members to Mailchimp and segment them based on their membership levels. You can then create targeted email campaigns for each segment.

MemberPress also lets you send custom fields to Mailchimp and add additional user information. By default, it will only send the email address and first name to Mailchimp. But you can edit the settings to map other fields as well.

Pros:

  • Easy to set up and use
  • Create unlimited membership levels
  • Easily integrates with Mailchimp
  • Offers powerful content access controls
  • Offers a drag-and-drop online course builder

Cons:

  • Limited payment options
  • Mapping custom fields in Mailchimp can be tricky for beginners

Why Use This Plugin: MemberPress is one of the best Mailchimp plugins because it makes it very easy to create a membership site. Plus, it helps you manage all your email needs by seamlessly integrating with Mailchimp.

Pricing: MemberPress is a premium plugin with prices starting from $179.50 per year.

10. RafflePress

Is RafflePress the best WordPress giveaway plugin?

RafflePress is the best WordPress giveaway plugin that helps you run viral giveaways to grow your email subscribers, social followers, and website traffic.

The plugin easily integrates with Mailchimp. You can add an option in your giveaway content to join your email newsletter and integrate it with Mailchimp. This way, when users enter their email addresses, they’re automatically added to Mailchimp.

Besides that, RafflePress offers a drag-and-drop giveaway builder, pre-built templates, social media integration, a custom giveaway landing page, and more.

Pros:

  • Drag and drop giveaway builder
  • Use pre-built giveaway templates
  • Fraud protection
  • Seamless integration with Mailchimp

Cons:

  • The free version doesn’t include Mailchimp integration
  • Limited customization options in the free version

Why Use This Plugin: The plugin is perfect for anyone who wants to run a viral giveaway and collect email addresses in Mailchimp. Both plugins smoothly integrate with each other.

Pricing: You’ll need at least the RafflePress Pro plan to unlock email integrations. This will cost you $99.50 per year.

11. Formidable Forms

Formidable forms

Formidable Forms is another popular contact form plugin for WordPress, and it also offers a Mailchimp addon. Formidable Forms lets you create complex and advanced forms without editing code.

For instance, you can create advanced calculators like mortgage calculators, time sheet forms, amortization calculators, registration forms, content download forms, web applications, and more.

With the Mailchimp addon, you can automatically send contacts gathered from the form over to Mailchimp. You also get options to sort leads with tags and groups in Mailchimp.

Other options include selecting a single or double opt-in, asking users to update their information when filling out the form, and more.

Pros:

  • Create complex forms and web applications
  • Drag and drop form builder
  • Multiple customization options
  • Seamless integration with Mailchimp
  • Create all types of WordPress forms

Cons:

  • High learning curve for creating complex forms
  • No Mailchimp integration in the free version

Why Use This Plugin: Do you want to create advanced and complex WordPress forms and manage leads in Mailchimp? If yes, then Formidable Forms is perfect for you. It offers pre-built form templates, a drag-and-drop form builder, lots of customization options, and more.

Pricing: Formidable Forms is a premium WordPress plugin. You’ll need at least the Plus plan to unlock Mailchimp integration, which is priced at $99.50 per year.

12. MailChimp Forms by MailMunch

Mailchimp forms by mailmunch

MailChimp Forms by MailMunch is one of the best free WordPress Mailchimp plugins on our list. The plugin deeply integrates with Mailchimp and lets you create beautiful opt-in forms for your website, eCommerce site, or blog.

With different opt-in forms, you can grab user’s attention and grow your email list. MailChimp Forms by MailMunch lets you create opt-in forms like popups with exit, sidebar widgets, top bars, scroll boxes, landing pages, and embedded forms.

Besides that, you can add additional information about your subscribers in Mailchimp. For instance, it lets you collect first and last names, email addresses, phone numbers, birthdays, and more.

The plugin offers other features as well. For instance, you can A/B test Mailchimp opt-in forms, enable welcome emails, and more. However, MailChimp Forms by MailMunch doesn’t offer many display rules or templates compared to OptinMonster.

Pros:

  • A free plugin that’s easy to use
  • Easily connects with Mailchimp
  • A/B test opt-in forms
  • Enable Google reCAPTCHA protection
  • GDPR compliant

Cons:

  • Limited opt-in forms options
  • Display rules are not that powerful
  • Not many customization options

Why Use This Plugin: If you’re looking for a free Mailchimp WordPress plugin to create opt-in forms for your site and grow your email list, then MailChimp Forms by MailMunch is among the best free solutions in the market.

Pricing: MailChimp Forms by MailMunch is a free WordPress plugin.

13. Easy Digital Downloads

The Easy Digital Downloads website

Easy Digital Downloads (EDD) is among the best eCommerce plugins for WordPress, and you can use it to sell digital products on WordPress. The plugin comes with powerful features and lets you create beautiful digital stores.

We use Easy Digital Downloads to sell our software, like WPForms and MonsterInsights. With that, we can easily say that it’s the best eCommerce platform for your site.

Easy Digital Downloads offers different extensions, including a Mailchimp extension. This helps you connect your email lists in Mailchimp to Easy Digital Downloads. When a customer purchases a product and enters an email address, it’s automatically saved in Mailchimp.

You can also show different email lists at checkout and let customers choose which list they’d like to subscribe to. EDD also supports Mailchimp’s eCommerce tracking, which shows the products that are driving the most subscribers.

If you’re using the Free Downloads extension in Easy Digital Downloads, then you can integrate it with Mailchimp. This way, you can grow your email list faster by offering free downloads.

Other than that, you can also use email templates offered by Mailchimp to run email campaigns, A/B test different email versions and improve email deliverability.

Pros:

  • Beginner-friendly to use
  • Works smoothly with any WordPress theme
  • Set up software licensing and sell all kinds of digital goods
  • Easily integrates with Mailchimp

Cons:

  • Selling non-digital products can be complicated
  • You’ll need third-party to sell external or affiliate products

Why Use This Plugin: Easy Digital Downloads makes it very easy to sell digital products. It is the best Mailchimp WordPress plugin, as you get to do so much more with your eCommerce website. For instance, automatically add customers to email groups, send targeted messages, create segments, and more.

Pricing: Easy Digital Downloads pricing plans start from $99.50 per year.

14. MC4WP: Mailchimp Top Bar

MailChimp top bar

MC4WP: Mailchimp Top Bar is a WordPress Mailchimp plugin that lets you add a customization sign-up bar at the top of your WordPress website.

You can show a beautiful sign-up bar at the top of the page to attract user attention. The best part, it automatically connects with your Mailchimp account and adds new subscribers to your preferred list or group.

The plugin offers decent customization options. You get to change the bar color, and text color, edit the text for the message and button, and more.

Pros:

  • Create stunning sign-up bars
  • Easily integrates with Mailchimp
  • Choose your Mailchimp lists and groups
  • Basic customization options
  • The plugin is 100% free

Cons:

  • Only limited to creating sign-up bars
  • There are no additional display rules

Why Use This Plugin: If you’re looking for a plugin to add a sign-up bar only, then this is the right plugin for you. It’s free to use and allows users to quickly enter their email address and subscribe to your emails.

Pricing: You can use the MC4WP: Mailchimp Top Bar plugin for free.

15. Featured Images in RSS for Mailchimp & More

Featured images in MailChimp RSS

Featured Images in RSS for Mailchimp & More is a free Mailchimp plugin that lets you add featured images to your RSS feed.

The plugin is super easy to use and offers different image size options, image alignment settings, image-to-text padding, and more. You can also use it with your WooCommerce store to show product photos in Mailchimp RSS campaigns.

Pros:

  • Simple and easy to use
  • Show featured images in the Mailchimp RSS feed
  • Free to use plugin

Cons:

  • Limited customization options in the free version
  • You cannot set custom image size in the free version

Why Use This Plugin: If you want to ensure that your blog post featured images appear in the RSS feed, then this is the plugin to use. You can set a particular image size and customize the image’s appearance in the feed.

Pricing: Featured Images in RSS for Mailchimp & More is a free WordPress plugin.

16. MonsterInsights

MonsterInsights horizontal navigation menu preview

MonsterInsights is the best Google Analytics plugin for WordPress that lets you enable Mailchimp form tracking in WordPress. It helps you set up Google Analytics in WordPress without editing code or hiring a developer.

For instance, you can use its Forms addon to track Mailchimp signup forms on your site. The plugin also shows reports inside your WordPress dashboard, so you can easily view data without having to leave your website.

You can see which Mailchimp form is performing the best. This way, you get to optimize low-converting forms while promoting high-performing forms even more.

Pros:

  • Set up Google Analytics in WordPress
  • View dashboard reports to make decisions
  • Track Mailchimp forms conversions
  • Set up advanced tracking like eCommerce tracking

Cons:

  • Forms addon is not available in the MonsterInsights Lite version

Why Use This Plugin: Do you want to track Mailchimp forms on your website and see which campaign is performing the best? Then MonsterInsights is the perfect solution for you. It is beginner-friendly and helps set up tracking without touching a single line of code.

Pricing: The MonsterInsights Forms addon is available in the Pro plan, which costs $199.50 per year. There is also a MonsterInsights Lite version that you can use for free, but it doesn’t include the Forms addon.

17. Contact Form 7 Extension For Mailchimp

Contact form 7 for mailchimp

Contact Form 7 Extension For Mailchimp is a free plugin that lets you integrate Contact Form 7 with Mailchimp. All your Contact Form 7 entries will be automatically added to an email list in Mailchimp.

The plugin is flexible and easy to set up. You can choose a predefined list to add new contacts to in Mailchimp. The plugin also lets you choose between single or double opt-in, as well as show an opt-in checkbox.

Pros:

  • Simple and easy interface
  • Easily connect mailing lists from Mailchimp
  • Add mailing list tags to subscribers
  • Show a single or double opt-in

Cons:

  • The plugin works only if you’re already using Contact Form 7
  • Not many customization options

Why Use This Plugin: If you are already using Contact Form 7 on your WordPress site, then this plugin is for you. It lets you pair Contact Form 7 with Mailchimp.

Pricing: Contact Form 7 Extension For Mailchimp is 100% free to use.

Which WordPress Mailchimp Plugin Should You Use?

After going through multiple plugins, choosing the best Mailchimp WordPress plugin depends on your needs. You can use multiple plugins in combination and integrate Mailchimp with your site.

For instance, if you’re looking to add different forms on your site and collect emails, then WPForms is the best plugin. You get multiple form templates, a drag-and-drop form builder, lots of customization options, and easy Mailchimp integration.

On the other hand, if you’re looking to get more email subscribers in Mailchimp, then we recommend OptinMonster. It offers pre-built templates, lots of campaign options, and powerful display rules.

Similarly, you can use Uncanny Automator and connect Mailchimp with other plugins and tools on your website. This way, you get to automate different tasks and let the plugin handle everything for you.

We hope this article helped you pick the best WordPress Mailchimp plugin. You may also want to see our list of best WooCommerce plugins and how to create a free business email address.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 17 Best WordPress Mailchimp Plugins for 2023 first appeared on WPBeginner.

Recovering Deleted Files From Your Git Working Tree

There are times when mistakes happen, and useful and important files are deleted by error or lost from your file system irrevocably (or seemingly, at least). Version control systems make it difficult to permanently lose files, provided they have been either added to staging or committed to a remote repository, because Git allows you to undo or revert changes and access previous versions of the saved files.

It is also possible to erroneously erase files from both the working directory and the Git repository. I’ve certainly done that! I imagine you have, too, if you’re reading this, and if that’s the case, then you will need a way to recover those files.

I have a few methods and strategies you can use to recover your deleted files. Some are more obvious than others, and some are designed for very specific situations. And while it is indeed possible to irrevocably lose a file, even then, you may have a path to at least recover a copy of it with third-party software if it comes to that.

How Git Works With Files

Before we dive into all of that, let’s explore how your files journey from your local computer to your remote repository.

Your files are initially only located on your computer’s storage, known as your working tree or working directory, and Git has no idea they exist yet. At this point, they are at their most vulnerable state since they are untracked.

Adding files to the staging area — also known as the index — so that Git is aware of them is what the git add <filename> (or git add -A for all files) is for. What actually happens under the hood when pushing files to staging is that Git hashes the content and creates a blob for each file based on the file’s content and proceeds to store them in the /objects subdirectory located at .git/objects. Run git status to confirm that the files you want to commit have been added to your staging area.

Once the files are staged, Git is at least aware of them, and we can include them in commits. When including a file in a commit, Git creates a new tree object to represent the state of the repository at the time the commit happens. The tree object contains the following information:

  • SHA-1 hash of the tree object that represents the state of the repository;
  • SHA-1 hash of the commit’s parent commit object if it has a parent;
  • Author and committer information;
  • Commit message.

It’s at this point that the files are git push-ed to the remote repo, wherever you happen to be hosting it, whether it’s GitHub, Beanstalk, Bitbucket, or whatever.

How Files Can Get Deleted From A Working Tree

So, the key pieces we’re talking about are your project’s working tree, staging area and commit. It is possible for files to be deleted at any one of these points, but it’s the working tree where it is most irreversible, or at least tough, to restore a lost file.

There are some very specific Git commands or actions that tend to be the biggest culprits when a file is deleted from the working tree.

git rm

I’m sure you have seen this one before. It’s a command for removing (rm) files from the working tree. It might be the most commonly used command for deleting files.

git reset

Anytime a reset happens, it’s very possible to lose any files you’ve been working on. But there are two types of Git resets that make this possible:

  1. git reset --hard
    This command is sort of a nuclear path for resetting a working tree and the staging area. If you’ve made any changes to tracked files, those will be lost. That goes for commits, too, which are discarded altogether. In fact, any files or directories that are not in the HEAD commit are removed from the working tree.
  2. git reset <filename>
    This is a lot less damaging than a hard reset, but it does indeed remove the specified file from the working tree. But it’s worth mentioning that the file is not pulled out from the staging area. So there’s a path back, which we’ll get to.

git clean

This removes untracked files from the working tree. Untracked files are not in the Git staging area and are not really part of the repository. They’re typically temporary files or files that have not yet been added to the repository.

One key distinction with a clean command is that it will not remove files that are included in a project’s .gitignore file, nor will it remove files that have been added to the staging area, nor ones that have already been committed. This can be useful for cleaning up your working tree after you have finished working on a project and you want to remove all of the temporary files that you created.

Like git reset, there are different variations of git clean that remove files in different ways:

  • git clean <filename>
    Used to remove specific files from the working tree.
  • git clean -d
    Removes untracked files from a specific directory.
  • git clean -i
    This one interactively removes files from the working tree. And by that, I mean you will be prompted to confirm removal before it happens, which is a nice safeguard against accidents.
  • git clean -n
    This is a dry run option and will show you the files that would be removed if you were to run the original git clean command. In other words, it doesn’t actually remove anything but lets you know what would be removed if you were to run an actual clean.
  • git clean -f
    This one forces the git clean command to remove all untracked files from the working tree, even if they are ignored by the .gitignore file. It’s pretty heavy-handed.
  • git clean -f -d
    Running this command is a lot like git clean --f but wipes out directories as well.
  • git clean -x
    This removes all untracked files, including build products. It is best used when you want to wipe your working tree clean and test a fresh build.
  • git clean -X
    This only removes files ignored by git.

Of course, I’m merely summarizing what you can already find in Git’s documentation. That’s where you can get the best information about the specific details and nuances of git clean and its variants.

Manually Removing Files

Yes, it’s possible! You can manually delete the files and directories from your working tree using your computer’s file manager. The good news, however, is that this will not remove the files from the staging area. Also, it’s quite possible you can undo that action with a simple CMD + Z/CTRL + Z if no other action has happened.

It is important to note that manually removing files from the working tree is a destructive operation. Once you have removed a file from the working tree that has not been added to a commit, it is almost impossible to undo the operation completely from a Git perspective. As a result, it is crucial to make sure that you really want to remove a file before you go this route.

But mistakes happen! So, let’s look at a variety of commands, strategies, and — if needed — apps that could reasonably recover deleted files from a working directory.

How Files Can Be Recovered After Being Deleted

Git commands like git checkout, git reset, git restore, and git reflog can be helpful for restoring files that you have either previously added to the staging area or committed to your repository.

git checkout

If you have not committed the changes that deleted the files and directories, then you can use the git checkout command to checkout a previous commit, branch, or tag. This will overwrite the working tree with the contents of the specific commit, branch, or tag, and any deleted files and directories will be restored.

git checkout HEAD~ <filename>

That will take things back to the last commit that was made. But let’s say you’ve made several commits since the file was deleted. If that’s the case, try checking out a specific commit by providing that commit’s hash:

git checkout <commit-hash> <filename>

Oh, you’re not sure which file it is, or there are more files than you want to type out? You can check out the entire working tree by committing the filename:

git checkout <commit-hash>

git reset

If you have committed the changes that deleted the files and directories, then you can use the git reset command to reset the HEAD pointer to a previous commit. This will also overwrite the working tree with the contents of the specific commit, and any deleted files and directories will be restored in the process.

git reset <commit-hash>

git restore

If you want to restore deleted files and directories without overwriting the working tree, then you can use the git restore command. This command restores files and directories deleted from the staging area or the working tree. Note that it only works for tracked files, meaning that any files that weren’t git add-ed to the working tree are excluded.

git restore --staged <filename>

To jump back one commit, you could go back to the --worktree instead of the staging area:

git restore --worktree <filename>

And, of course, leave out the filename if you want to restore all files in the working tree from the previous commit:

git restore --worktree

Another option is to restore all of the files in the current directory:

git restore .

git reflog

There’s also the git reflog command, which shows a history of all recent HEAD movements. I like this as a way to identify the commit that you want to checkout or reset to.

git reflog
Last Resorts

When files that are neither present in the staging area nor committed are deleted from the working tree, it is commonly accepted that those files are gone forever — or oti lor as we say in Yoruba — without any hope of recovery. So, if for any reason or by error, you delete important files from your project’s working tree without ensuring that they are either in the staging area or have been previously committed, then you may be thinking all hope of getting them back is lost.

But I can assure you, based on my experiences in this situation, that it is usually possible to recover all or most of a project’s lost files. There are two approaches I normally take.

File Recovery Apps

File recovery tools can recover lost or deleted data from your storage devices. They work by running a deep scan of your device in an attempt to find every file and folder that has ever existed on your storage device, including deleted and lost files and folders. Once the files have all been found, you can then use the data recovery tool to restore/recover the files of your choice to a new location.

Note: Some of the deleted and lost files found may be corrupted and damaged or not found at all, but I am certain from my experience using them that the majority will be found without any corruption or damage.

There are a variety of file recovery tools available, and the “right” one is largely a subjective matter. I could spend an entire post exclusively on the various options, but I’ve selected a few that I have used and feel comfortable at least suggesting as options to look into.

Wondershare Recoverit is capable of recovering more than 1,000 file formats. Its free tier option allows you to run a scan to find files on your computer’s storage, but to actually recover the files, you will have to do a paid upgrade to one of its paid plans starting at a $69.99 annual subscription or a one-time $119.99 license. There’s a premium plan for more enhanced recovery methods for things like videos and files, as well as fixing corrupted files that go well beyond the basic need of recovering a single lost file.

  • Pros: High success rate, free tech support, allows partition recovery.
  • Cons: Free tier is extremely limited.

EaseUS Data Recovery Wizard is perhaps one of the most popular tools out of what’s available. Its free tier option is quite robust, running a deep scan and recovering up to 2GB of data. The difference between that and its paid subscription (starting at $119.95 per year, $169.95 lifetime) is that the paid tier recovers an unlimited amount of data.

  • Pros: Fast deep scans, file preview before recovery, easy to use, generous free tier.
  • Cons: Paid plans are significantly more expensive than other tools, Windows and macOS versions are vastly different, and the macOS software is even more expensive.

DM Disk Editor (DMDE) makes use of a special algorithm that reconstructs directory structures and recovers files by their file signature when recovering solely by the file system proves impossible. DMDE also offers a free tier option, but it is quite limited as you can only recover files from the directory you have selected, and it only recovers up to 4,000 files at a time. Compare that to its paid versions that allow unlimited and unrestricted data recovery. Paid plans start at $20 per year but scale up to $133 per year for more advanced needs that are likely beyond the scope of what you need.

  • Pros: High recovery success rate, generous free tier, reasonable paid tiers if needed.
  • Cons: I personally find the UI to be more difficult to navigate than other apps.
Software Operating Systems supported Starting price File types and formats supported
Wondershare Recoverit Windows, Mac, Linux(Premium) $69.99/year 1000+ file types and formats
EaseUS Windows, Mac $99.95/year (Windows), $119.95/year (Mac) 1000+ file types and formats
DMDE Windows, Mac, Linux, DOS $20/year Supports basic file formats. Does not support raw photo files.

As I said, there are many, many more options out there. If you’re reading this and have a favorite app that you use to recover lost files, then please share it in the comments. The more, the merrier!

Last Resort: git fsck

First off, the git fsck command can be dangerous if used incorrectly. It is essential to make sure that you understand how to use the command before using it to recover files from the working tree. If you are unsure how to proceed after reading this section, then it is a good idea to consult the Git documentation for additional details on how it is used and when it is best to use it.

That said, git fsck can indeed recover files lost from the working tree in Git and maybe your absolute last resort. It works by scanning the Git repository for “dangling” objects, which are objects that are not referenced by any commit. The Git docs define it like this:

dangling object:

“An unreachable object that is not reachable even from other unreachable objects; a dangling object has no references to it from any reference or object in the repository.”

This can happen if a file is deleted from the working tree but not committed or if a branch is deleted, but the files on the branch are not deleted.

To recover files lost from the working tree using the git fsck command, follow these steps:

  • Run git fsck –lost-found, which is a special mode of the git fsck command.
    It creates a directory called .git/lost-found and moves all of the lost objects to that directory. The lost objects are organized into two subdirectories: commits and objects. The /commits subdirectory contains lost commits, and the /objects subdirectory contains lost blobs, trees, and tags. This command prints the dangling objects (blobs, commits, trees, and tags) if they exist.

  • Run the git show <dangling_object_hash> command for each dangling object that is printed.
    This will print the content of the object and enable you to see the original content of the hashed object so you can identify the dangling objects in the case of files dangling blobs that correspond to the files that you want to recover.
  • To recover a dangling object, you can manually copy the content of the printed in the console when you run the git show <dangling_object_hash> command or run git show <dangling_object_hash> > <filename> command to save the content of the hashed object to the file you specified in the command. You can also use the git checkout <dangling_object_hash> command to restore the file to the working tree.

Once you have recovered the files that you want to recover, you can commit the changes to the Git repository as if nothing ever happened. Phew! But again, I only advise this approach if you’ve tried everything else and are absolutely at your last resort.

Conclusion

Now that you know how to recover files lost from your working tree, your mind should be relatively at ease whenever or if ever you find yourself in this unfortunate situation. Remember, there’s a good chance to recover a file that may have been accidentally deleted from a project.

That said, a better plan is to prevent being in this situation in the first place. Here are some tips that will help you prevent ending up almost irrevocably losing files from your working tree:

  • Commit your files to your Git repository and remote servers as quickly and as often as you create or make changes to them.
    There is no such thing as a “too small” commit.
  • Routinely create backups of your project files.
    This will help you recover your files if you accidentally delete them or your computer crashes.

Further Reading On SmashingMag

Q*: What is OpenAI Hiding?

In the whirlwind of recent events at OpenAI, a host of unanswered questions has arisen, particularly surrounding the mysterious Q* project. What secrets are hidden beneath the surface of the latest drama in the world of AI, and which unspoken discoveries might OpenAI have in stock?

openai-q.jpg

The latest leadership crisis at OpenAI, occurring one year after the release of ChatGPT, was nothing short of dramatic. Sam Altman's abrupt dismissal as CEO set off a chain of events, including an open letter signed by most of the company's employees. Altman's subsequent return and the resignation of most board members paint a vivid picture of deep internal conflicts. The turmoil, possibly fueled by diverging visions for the future of AI, coincides with whispers of a potential breakthrough, known as Q*. Here is what we know about Q*, what we don't know, and experts' opinions on whether it is really a breakthrough or just another sign of steady progress achieved by OpenAI.

What We Know About Q-Star

As recent developments at OpenAI stirred the tech world, a secretive project known as Q* (pronounced "Q-Star") fuels new speculations about AGI having been achieved internally. However, at the time of writing, little is publicly known about Q*, as OpenAI refuses to release any details about the project, although Sam Altman confirmed the leak in an interview. Yet, there are claims that Q* possesses exceptional mathematical abilities, potentially marking the next exponential leap in AI development.

Notably, Q* should not be confused with the Q* variable in Bellman's equation, a well-known concept in reinforcement learning. In Bellman's framework, Q* represents the optimal action-value function, a fundamental element in the process of determining the best action to take in a given state. This mathematical principle is crucial for decision-making processes in AI. In contrast, Q* at OpenAI, as referenced in the Reuters article, appears to be a codename for an AI model or project with outstanding mathematical prowess, possibly by combining Q-learning and the A*-algorithm. It is rumored that Q* bears the potential to perform tasks that go beyond calculations, possibly incorporating elements of reasoning and abstraction. This distinction hints at its potential to be a significant milestone in the journey towards AGI.

Mathematical Potential & OpenAI's Secrecy

One of the most fascinating aspects of Q* is its reported ability to solve mathematical problems at a grade-school level. While this might sound modest, it's a substantial advancement for AI. Most current AI systems excel in pattern recognition and prediction but struggle with reasoning and problem-solving, which are crucial for AGI. Q*'s mathematical abilities indicate a step towards more complex, human-like reasoning in AI.

At the same time, OpenAI is rumored to solving the data scarcity problem in AI development. If true, this could be a monumental breakthrough. Data scarcity has been a significant barrier in training AI models, as robust datasets are essential for accurate and effective machine learning. Overcoming this hurdle could lead to more rapid advancements in AI, enabling models to learn and adapt with less data, and potentially reducing system biases. Such a development could exponentially accelerate progress towards more sophisticated AI, but it also raises important questions about the ethical implications and the responsible deployment of these increasingly powerful technologies.

OpenAI has maintained a veil of secrecy around the exact nature of Q*, a decision that intertwines intriguingly with Sam Altman's enigmatic comments before his brief removal as CEO, when he spoke of pushing "the veil of ignorance back," a statement that fueled speculation about a significant breakthrough at OpenAI, potentially linked to Q*. However, in the absence of concrete information about Q*, the tech community can only speculate about this discovery and its potential implications for the future of AI.

Wild Speculations & a Realist Lense

Among the most enthralling theories is the notion that Q* might be a groundbreaking step toward AGI, while some even hypothesize a connection between Q* and Artificial Super Intelligence (ASI). Yet, amid this swirl of speculation, more grounded perspectives suggest that Q* might be less of a radical innovation and more an extension of existing research at OpenAI. Esteemed AI researchers, including Meta's Yann LeCun, perceive Q* as potentially building upon current work, integrating techniques like Q-learning, which enhances task performance, and A*, an algorithm for exploring pathways in complex networks. These speculations align Q* with ongoing trends in AI research, indicating steady progress rather than a seismic shift.

Further tempering the sensational claims, researchers like Nathan Lambert of the Allen Institute for AI claim that Q* focuses on enhancing mathematical reasoning in AI models. This improvement, while significant, is seen as a step towards refining the capabilities of language models like ChatGPT, rather than catapulting AI into the realms of AGI or ASI. The view is that Q*, by advancing mathematical problem-solving skills, could contribute to the evolution of AI, making it a more effective tool, particularly in fields demanding precise reasoning and logic.

Balancing Ethics & Competition in AI Innovation

Nevertheless, even if the Q* project is just a sign of steady progress and not a breakthrough, it raises important questions about the implications of AI discoveries from both ethical and commercial perspectives. Ethically, OpenAI's caution could stem from the potential risks associated with advanced AI developments. These include concerns about privacy, bias, misuse, and the broader societal impact. Just imagine AGI decrypting things that better stay encrypted. Advanced AI systems, if not developed and deployed responsibly, could lead to unintended consequences, ranging from ethical dilemmas in decision-making to human extinction. Hence, OpenAI's secrecy might be a necessary measure to ensure that all ethical considerations are thoroughly addressed before any public disclosure.

Commercially, OpenAI's restraint could be a strategic move in a highly competitive field. Revealing details about Q* prematurely could jeopardize its competitive edge, especially if the technology is still in an early stage needing refinement. Google's DeepMind and other competitors are said to work on similar projects, while DeepMind is also inching closer to give us superconductors. In the fiercely competitive tech industry, where breakthroughs can lead to significant financial gains, maintaining confidentiality ensures that OpenAI retains exclusive control over its innovations. This approach could be about strategically positioning the company in the race towards AGI, a race where first movers might reap immense rewards. The recent turmoil on management-level most likely reflects internal disagreements on whether to prioritize commercial gains or caution in respect to ethical concerns.

Q-Star and the Future of Artificial Intelligence

The enigma of Q* at OpenAI encapsulates the broader narrative of AI's progress a blend of speculation, innovation, and caution. While we all eagerly anticipate the next breakthrough, OpenAI's secrecy about some of its projects serves as a reminder of the responsibility that accompanies such advancements. As we are witnessing potentially transformative AI developments, it becomes imperative to balance the thrill of discovery with the wisdom of foresight, ensuring a future where AI serves all of us, and not the other way around.